[postgis-users] shp2pgsql segfault and gdb

strk at refractions.net strk at refractions.net
Fri Sep 30 01:47:08 PDT 2005


On Thu, Sep 29, 2005 at 07:12:07PM -0400, Amos Hayes wrote:
...
> Just thought I'd let you know that when I run shp2pgsql on a shape  
> file containing "LATIN1" characters but don't specify "-W LATIN1" as  
> a parameter to shp2pgsql, I see a similar type of error:
> 
> *** glibc detected *** double free or corruption (out):  
> 0x0000007fbffff390 ***
> 
> Stumped me for a while there.

The following patch should fix it, can you confirm ?

--strk(patch_follows);

Index: shp2pgsql.c
===================================================================
RCS file: /home/cvs/postgis/postgis/loader/shp2pgsql.c,v
retrieving revision 1.88.2.7
diff -U2 -r1.88.2.7 shp2pgsql.c
--- shp2pgsql.c 29 Aug 2005 22:36:14 -0000      1.88.2.7
+++ shp2pgsql.c 30 Sep 2005 08:45:42 -0000
@@ -188,5 +188,5 @@

 #ifdef USE_ICONV
-       free(str);
+       if ( encoding ) free(str);
 #endif

@@ -241,5 +241,5 @@

 #ifdef USE_ICONV
-       free(str);
+       if ( encoding ) free(str);
 #endif





More information about the postgis-users mailing list