From e7a39cde3626d4649400f49ce0e66bbb77fce70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Tue, 15 Mar 2016 18:41:59 +0000 Subject: [PATCH] [core] fix memory leak in configparser_merge_data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release op1 memory on failure; fixes some theoretical memory leaks (a failure results in early exit anyway). From: Stefan Bühler git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3101 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/configparser.y | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 06178ea8..7aa27219 100644 --- a/NEWS +++ b/NEWS @@ -29,6 +29,7 @@ NEWS * [mod_fastcgi,mod_scgi] fix leaking file-descriptor when backend spawning failed (reported by Fortify Open Review Project) * [core] improve array API to prevent memory leaks * [core] refactor array search; raise array size limit to SSIZE_MAX + * [core] fix memory leak in configparser_merge_data - 1.4.39 - 2016-01-02 * [core] fix memset_s call (fixes #2698) diff --git a/src/configparser.y b/src/configparser.y index 10241456..24efb6b0 100644 --- a/src/configparser.y +++ b/src/configparser.y @@ -71,6 +71,7 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) { return (data_unset *)ds; } else { fprintf(stderr, "data type mismatch, cannot merge\n"); + op1->free(op1); return NULL; } }