From 585bd29bbf954d5f53e72b77c3232d6c9f24d537 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 4 Feb 2003 22:57:44 +0000 Subject: [PATCH] Fix memory management error, array of pointers allocated insufficient space. git-svn-id: http://svn.osgeo.org/postgis/trunk@237 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/shp2pgsql.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/loader/shp2pgsql.c b/loader/shp2pgsql.c index da0dfe0b4..de2d3db40 100644 --- a/loader/shp2pgsql.c +++ b/loader/shp2pgsql.c @@ -4,6 +4,9 @@ * Author: Jeff Lounsbury, jeffloun@refractions.net * * $Log$ + * Revision 1.29 2003/02/04 22:57:44 pramsey + * Fix memory management error, array of pointers allocated insufficient space. + * * Revision 1.28 2003/02/04 21:39:20 pramsey * Added CVS substitution strings for logging. * @@ -552,7 +555,7 @@ int main (int ARGC, char **ARGV){ num_fields = DBFGetFieldCount( hDBFHandle ); num_records = DBFGetRecordCount(hDBFHandle); - names = malloc(num_fields +1); + names = malloc((num_fields + 1)*sizeof(char*)); for(j=0;j