Browse Source

projlib: fix https://trac.osgeo.org/grass/changeset/35667

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53208 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 years ago
parent
commit
cb6e59e445
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lib/proj/ellipse.c

+ 4 - 1
lib/proj/ellipse.c

@@ -71,7 +71,7 @@ GPJ__get_ellipsoid_params(struct Key_Value *proj_keys,
 	/* else use ellipsoid defined in PROJ_INFO */
 	ellps = G_store(G_find_key_value("ellps", proj_keys));
 
-    if (ellps != NULL) {
+    if (ellps != NULL && *ellps) {
 	if (GPJ_get_ellipsoid_by_name(ellps, &estruct) < 0)
 	    G_fatal_error(_("Invalid ellipsoid <%s> in file"), ellps);
 
@@ -84,6 +84,9 @@ GPJ__get_ellipsoid_params(struct Key_Value *proj_keys,
 	return 1;
     }
     else {
+	if (ellps)    /* *ellps = '\0' */
+	    G_free(ellps);
+
 	str3 = G_find_key_value("a", proj_keys);
 	if (str3 != NULL) {
 	    char *str4;