aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2015-06-20 22:47:41 +0200
committerEven Rouault <even.rouault@mines-paris.org>2015-06-20 22:47:41 +0200
commitbfcc2516bd77649267954ad1081f4cc2ee0b2fa9 (patch)
treeea6865c2027c34f0a585004ff02701e00965816d /src
parent6f62750f39fc1dc6b3b4e4b6ed2a67dc2c9df362 (diff)
parente8034c77e549627c638b7db89929e3a2f8e08ec1 (diff)
downloadPROJ-bfcc2516bd77649267954ad1081f4cc2ee0b2fa9.tar.gz
PROJ-bfcc2516bd77649267954ad1081f4cc2ee0b2fa9.zip
Merge branch '149_memory_leak'
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;