]> granicus.if.org Git - postgis/commitdiff
Do not free state->geo_col, and do not strdup when assigning defaults
authorSandro Santilli <strk@kbt.io>
Mon, 29 Jul 2019 14:00:00 +0000 (14:00 +0000)
committerSandro Santilli <strk@kbt.io>
Mon, 29 Jul 2019 14:00:00 +0000 (14:00 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@17630 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql-core.c

index 01b59727e4eef7a01f98d64f85d6b9eb849c64fc..dc71310eb87754d3959542a305436d12eaa99398 100644 (file)
@@ -816,7 +816,7 @@ ShpLoaderCreate(SHPLOADERCONFIG *config)
 
        if (!state->geo_col)
        {
-               state->geo_col = strdup(config->geography ? GEOGRAPHY_DEFAULT : GEOMETRY_DEFAULT);
+               state->geo_col = config->geography ? GEOGRAPHY_DEFAULT : GEOMETRY_DEFAULT;
        }
 
        colmap_init(&state->column_map);
@@ -1952,8 +1952,6 @@ 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);