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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 12 00:15:59 PDT 2018


Author: mmetz
Date: 2018-06-12 00:15:59 -0700 (Tue, 12 Jun 2018)
New Revision: 72802

Modified:
   grass/trunk/lib/proj/convert.c
Log:
libproj: do not free a pointer internal to a OGRSpatialReference; +safety check before calling OSRDestroySpatialReference()

Modified: grass/trunk/lib/proj/convert.c
===================================================================
--- grass/trunk/lib/proj/convert.c	2018-06-12 03:28:26 UTC (rev 72801)
+++ grass/trunk/lib/proj/convert.c	2018-06-12 07:15:59 UTC (rev 72802)
@@ -858,8 +858,6 @@
 	    i = 0;
 	    while (gpj_units[i].id != NULL) {
 		if (strcmp(proj4_unit, gpj_units[i].id) == 0) {
-		    if (pszUnitsName)
-			G_free(pszUnitsName);
 		    G_asprintf(&pszUnitsName, "%s", gpj_units[i].name);
 		    break;
 		}
@@ -918,7 +916,7 @@
     *projinfo = NULL;
     *projunits = NULL;
 
-    if (hSRS != hSRS1)
+    if (hSRS != NULL && hSRS != hSRS1)
 	OSRDestroySpatialReference(hSRS);
 
     return 1;



More information about the grass-commit mailing list