From 18003e7235aba03574f761af300b856810302393 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 30 Sep 2005 08:59:21 +0000 Subject: [PATCH] Fixed release of stack memory occurring when shp2pgsql is compiled with USE_ICONV defined, an attribute value needs to be escaped and no -W is used git-svn-id: http://svn.osgeo.org/postgis/branches/pgis_1_0@1948 b70326c6-7e19-0410-871a-916f4a2858ee --- CHANGES | 1 + loader/shp2pgsql.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 7e69a72b3..8ab3257a5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ PostGIS 1.0.5CVS - New "Reporting Bugs" chapter in manual + - Segfault fix in shp2pgsql (utf8 encoding) PostGIS 1.0.4 2005/09/09 diff --git a/loader/shp2pgsql.c b/loader/shp2pgsql.c index af30f75ea..0a00af376 100644 --- a/loader/shp2pgsql.c +++ b/loader/shp2pgsql.c @@ -187,7 +187,7 @@ make_good_string(char *str) *optr='\0'; #ifdef USE_ICONV - free(str); + if ( encoding ) free(str); #endif return result; @@ -240,7 +240,7 @@ protect_quotes_string(char *str) *optr='\0'; #ifdef USE_ICONV - free(str); + if ( encoding ) free(str); #endif return result; @@ -1660,6 +1660,9 @@ utf8 (const char *fromcode, char *inputbuf) /********************************************************************** * $Log$ + * Revision 1.88.2.8 2005/09/30 08:59:21 strk + * Fixed release of stack memory occurring when shp2pgsql is compiled with USE_ICONV defined, an attribute value needs to be escaped and no -W is used + * * Revision 1.88.2.7 2005/08/29 22:36:14 strk * Removed premature object destruction in InsertLineString{WKT,} causing segfault * -- 2.40.0