aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-09-04 09:51:14 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-09-04 09:51:14 +0200
commit0d50cc980df7b5b25be8ea29689cdfe08c587650 (patch)
tree1e67a8e746fca98ce166580ec489e9ea5d2eafad
parentefe7db5daf1067d57be1726193a7b59d5ba038af (diff)
downloadPROJ-0d50cc980df7b5b25be8ea29689cdfe08c587650.tar.gz
PROJ-0d50cc980df7b5b25be8ea29689cdfe08c587650.zip
PJ_hgridshift.c: fix memleak in initialization if grid loading fail. Same fix as commit e1ad1046873056ab3bfc3262bd343e8c874f395c. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3276. Credit to OSS Fuzz
-rw-r--r--src/PJ_hgridshift.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/PJ_hgridshift.c b/src/PJ_hgridshift.c
index 41c2b629..674b4da8 100644
--- a/src/PJ_hgridshift.c
+++ b/src/PJ_hgridshift.c
@@ -81,6 +81,8 @@ PJ *PROJECTION(hgridshift) {
/* Was gridlist compiled properly? */
if ( pj_ctx_get_errno(P->ctx) ) {
proj_log_error(P, "hgridshift: could not find required grid(s).");
+ pj_dalloc(P->gridlist);
+ P->gridlist = NULL;
return freeup_msg(P, -38);
}