aboutsummaryrefslogtreecommitdiff
path: root/src/nad_init.c
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-06-01 12:50:23 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-06-01 12:50:23 +0200
commit28cbf0d771a478213c23644650f6c862a9310270 (patch)
tree86667f034b61b59172be1be26f4689469c20b3f7 /src/nad_init.c
parent37369f208496646b88e9728f59a6f7eabc307a96 (diff)
downloadPROJ-28cbf0d771a478213c23644650f6c862a9310270.tar.gz
PROJ-28cbf0d771a478213c23644650f6c862a9310270.zip
Fix memory leaks. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2000. Credit to OSS Fuzz
Diffstat (limited to 'src/nad_init.c')
-rw-r--r--src/nad_init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nad_init.c b/src/nad_init.c
index a84b0387..0a28e200 100644
--- a/src/nad_init.c
+++ b/src/nad_init.c
@@ -122,6 +122,7 @@ struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid )
|| pj_ctx_fread( ctx, ct, sizeof(struct CTABLE), 1, fid ) != 1 )
{
pj_ctx_set_errno( ctx, -38 );
+ pj_dalloc( ct );
return NULL;
}
@@ -130,6 +131,7 @@ struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid )
|| ct->lim.phi < 1 || ct->lim.phi > 100000 )
{
pj_ctx_set_errno( ctx, -38 );
+ pj_dalloc( ct );
return NULL;
}