aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-08-20 00:35:37 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-08-20 00:35:37 +0200
commit231df5a72fcd5d37c21e759f349362574c9613ef (patch)
tree3efdabdae93c3759a851f5d81b978ca9829a81f9 /src
parentd00501750b210a73f9fb107ac97a683d4e3d8e7a (diff)
downloadPROJ-231df5a72fcd5d37c21e759f349362574c9613ef.tar.gz
PROJ-231df5a72fcd5d37c21e759f349362574c9613ef.zip
PJ_aea.c: fix memory leak in error code path. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2723. Credit to OSS Fuzz
Diffstat (limited to 'src')
-rw-r--r--src/PJ_aea.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/PJ_aea.c b/src/PJ_aea.c
index 303a319e..7d0e935d 100644
--- a/src/PJ_aea.c
+++ b/src/PJ_aea.c
@@ -175,7 +175,9 @@ static PJ *setup(PJ *P) {
m2 = pj_msfn(sinphi, cosphi, P->es);
ml2 = pj_qsfn(sinphi, P->e, P->one_es);
if (ml2 == ml1)
- return NULL;
+ {
+ return freeup_new(P);
+ }
Q->n = (m1 * m1 - m2 * m2) / (ml2 - ml1);
}
Q->ec = 1. - .5 * P->one_es * log((1. - P->e) /