From 0d50cc980df7b5b25be8ea29689cdfe08c587650 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 4 Sep 2017 09:51:14 +0200 Subject: 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 --- src/PJ_hgridshift.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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); } -- cgit v1.2.3