[GRASS-SVN] r71548 - grass/trunk/lib/proj

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 11 01:03:37 PDT 2017


Author: mmetz
Date: 2017-10-11 01:03:36 -0700 (Wed, 11 Oct 2017)
New Revision: 71548

Modified:
   grass/trunk/lib/proj/convert.c
Log:
projlib: fix small memory leak in GPJ_osr_to_grass()

Modified: grass/trunk/lib/proj/convert.c
===================================================================
--- grass/trunk/lib/proj/convert.c	2017-10-10 08:27:06 UTC (rev 71547)
+++ grass/trunk/lib/proj/convert.c	2017-10-11 08:03:36 UTC (rev 71548)
@@ -390,6 +390,9 @@
     struct gpj_datum dstruct;
     const char *ograttr;
 
+    *projinfo = NULL;
+    *projunits = NULL;
+
     if (hSRS == NULL)
 	goto default_to_xy;
 
@@ -837,6 +840,8 @@
 	cellhd->proj = PROJECTION_XY;
 	cellhd->zone = 0;
     }
+    if (*projinfo)
+	G_free_key_value(*projinfo);
 
     *projinfo = NULL;
     *projunits = NULL;



More information about the grass-commit mailing list