diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2017-11-11 22:20:51 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2017-11-11 22:20:51 +0100 |
| commit | d53581ab6840713e4cb24c6f735cf04e9ce0b2db (patch) | |
| tree | 1695e43f706247777c3f0eeae201cfdb89c2907f /src/pj_init.c | |
| parent | fecc6c7ef424e2af14914b88137ca98433f5530b (diff) | |
| download | PROJ-d53581ab6840713e4cb24c6f735cf04e9ce0b2db.tar.gz PROJ-d53581ab6840713e4cb24c6f735cf04e9ce0b2db.zip | |
Fix various memory leaks. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3573 , https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3643 and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3641 . Credit to OSS Fuzz
Diffstat (limited to 'src/pj_init.c')
| -rw-r--r-- | src/pj_init.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pj_init.c b/src/pj_init.c index f69d9eae..534f0827 100644 --- a/src/pj_init.c +++ b/src/pj_init.c @@ -500,7 +500,7 @@ pj_init_ctx(projCtx ctx, int argc, char **argv) { /* find projection selection */ if (!(name = pj_param(ctx, start, "sproj").s)) - return pj_default_destructor (PIN, PJD_ERR_PROJ_NOT_NAMED); + return pj_dealloc_params (ctx, start, PJD_ERR_PROJ_NOT_NAMED); for (i = 0; (s = pj_list[i].id) && strcmp(name, s) ; ++i) ; if (!s) @@ -693,7 +693,10 @@ pj_init_ctx(projCtx ctx, int argc, char **argv) { /* projection specific initialization */ PIN = proj(PIN); if ((0==PIN) || ctx->last_errno) + { + pj_free(PIN); return 0; + } return PIN; } |
