[postgis-tickets] r17630 - Do not free state->geo_col, and do not strdup when assigning defaults

Sandro Santilli strk at kbt.io
Mon Jul 29 07:00:01 PDT 2019


Author: strk
Date: 2019-07-29 07:00:00 -0700 (Mon, 29 Jul 2019)
New Revision: 17630

Modified:
   trunk/loader/shp2pgsql-core.c
Log:
Do not free state->geo_col, and do not strdup when assigning defaults

Modified: trunk/loader/shp2pgsql-core.c
===================================================================
--- trunk/loader/shp2pgsql-core.c	2019-07-29 13:59:52 UTC (rev 17629)
+++ trunk/loader/shp2pgsql-core.c	2019-07-29 14:00:00 UTC (rev 17630)
@@ -816,7 +816,7 @@
 
 	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 @@
 			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);



More information about the postgis-tickets mailing list