aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDidier Richard <didier.richard@ign.fr>2012-03-09 09:37:00 +0000
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2015-05-29 18:21:31 -0400
commite8034c77e549627c638b7db89929e3a2f8e08ec1 (patch)
tree0364d1bd850c61d9cb08ca05573fa18c3881af91 /src
parentbc68930723d48f2669d6bd9ebe176614e9dd893d (diff)
downloadPROJ-e8034c77e549627c638b7db89929e3a2f8e08ec1.tar.gz
PROJ-e8034c77e549627c638b7db89929e3a2f8e08ec1.zip
Fix small memory leak in pj_init.
Diffstat (limited to 'src')
-rw-r--r--src/pj_init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pj_init.c b/src/pj_init.c
index bea4f86c..59bd2c88 100644
--- a/src/pj_init.c
+++ b/src/pj_init.c
@@ -312,7 +312,7 @@ pj_init_plus_ctx( projCtx ctx, const char *definition )
char *argv[MAX_ARG];
char *defn_copy;
int argc = 0, i, blank_count = 0;
- PJ *result;
+ PJ *result = NULL;
/* make a copy that we can manipulate */
defn_copy = (char *) pj_malloc( strlen(definition)+1 );
@@ -337,7 +337,7 @@ pj_init_plus_ctx( projCtx ctx, const char *definition )
if( argc+1 == MAX_ARG )
{
pj_ctx_set_errno( ctx, -44 );
- return NULL;
+ goto bum_call;
}
argv[argc++] = defn_copy + i + 1;
@@ -365,6 +365,7 @@ pj_init_plus_ctx( projCtx ctx, const char *definition )
/* perform actual initialization */
result = pj_init_ctx( ctx, argc, argv );
+bum_call:
pj_dalloc( defn_copy );
return result;