aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-08-29 10:25:47 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-08-29 10:25:47 +0200
commit56075006131263e0859808d263d6d22cd4594fb9 (patch)
treeb7bd25728efdf20efb079671c63b975db482f7be /src
parente044eb01eefb29187379c694f5d51d91360d3143 (diff)
downloadPROJ-56075006131263e0859808d263d6d22cd4594fb9.tar.gz
PROJ-56075006131263e0859808d263d6d22cd4594fb9.zip
PJ_horner.c: fix memory leaks. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3204. Credit to OSS Fuzz
Diffstat (limited to 'src')
-rw-r--r--src/PJ_horner.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/PJ_horner.c b/src/PJ_horner.c
index 56980f72..c6560d3a 100644
--- a/src/PJ_horner.c
+++ b/src/PJ_horner.c
@@ -128,6 +128,8 @@ static void horner_free (HORNER *h) {
horner_dealloc (h->fwd_u);
horner_dealloc (h->fwd_c);
horner_dealloc (h->inv_c);
+ horner_dealloc (h->fwd_origin);
+ horner_dealloc (h->inv_origin);
horner_dealloc (h);
}
@@ -406,8 +408,10 @@ static int parse_coefs (PJ *P, double *coefs, char *param, int ncoefs) {
}
sprintf (buf, "t%s", param);
- if (0==pj_param (P->ctx, P->params, buf).i)
+ if (0==pj_param (P->ctx, P->params, buf).i) {
+ pj_dealloc (buf);
return 0;
+ }
sprintf (buf, "s%s", param);
init = pj_param(P->ctx, P->params, buf).s;
pj_dealloc (buf);