]> granicus.if.org Git - postgis/commitdiff
Fix memory leaks in shp2pgsql
authorSandro Santilli <strk@kbt.io>
Mon, 29 Jul 2019 13:59:52 +0000 (13:59 +0000)
committerSandro Santilli <strk@kbt.io>
Mon, 29 Jul 2019 13:59:52 +0000 (13:59 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@17629 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql-cli.c
loader/shp2pgsql-core.c

index 678e91a11e8507a3a72c806f181bcd7cc0988795..8ab1214207c10554c11a48c78056bc2e4024c3ab 100644 (file)
@@ -446,6 +446,8 @@ main (int argc, char **argv)
                free(config->schema);
        if (config->table)
                free(config->table);
+       if (config->encoding)
+               free(config->encoding);
        free(config);
 
        return 0;
index 8fae746bb40a065c7b421a37436358c761fd10ec..01b59727e4eef7a01f98d64f85d6b9eb849c64fc 100644 (file)
@@ -1952,6 +1952,8 @@ ShpLoaderDestroy(SHPLOADERSTATE *state)
                        free(state->precisions);
                if (state->col_names)
                        free(state->col_names);
+               if (state->geo_col)
+                       free(state->geo_col);
 
                /* Free any column map fieldnames if specified */
                colmap_clean(&state->column_map);