aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-05-20 22:07:45 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-05-22 12:02:25 +0200
commit9422539e0b9e9ccd393ca051828bda2e5b8f4beb (patch)
treed4018f1ed0a53f49c6db62796992c4d64beb0e3a
parent4730f1a8ddf849278f298842a08c7ff2d9b574bb (diff)
downloadPROJ-9422539e0b9e9ccd393ca051828bda2e5b8f4beb.tar.gz
PROJ-9422539e0b9e9ccd393ca051828bda2e5b8f4beb.zip
PJ_wag3: Fix memory leak of opaque member
Credit to OSS Fuzz
-rw-r--r--src/PJ_wag3.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/PJ_wag3.c b/src/PJ_wag3.c
index cd6c18e9..7f5aa4ad 100644
--- a/src/PJ_wag3.c
+++ b/src/PJ_wag3.c
@@ -28,13 +28,8 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
return lp;
}
-
-static void *freeup_new (PJ *P) { /* Destructor */
- return pj_dealloc(P);
-}
-
static void freeup (PJ *P) {
- freeup_new (P);
+ pj_freeup_plain (P);
return;
}
@@ -43,7 +38,10 @@ PJ *PROJECTION(wag3) {
double ts;
struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
if (0==Q)
- return freeup_new (P);
+ {
+ freeup(P);
+ return 0;
+ }
P->opaque = Q;
ts = pj_param (P->ctx, P->params, "rlat_ts").f;