From: Andreas Seltenreich Date: Thu, 3 Mar 2016 19:32:23 +0000 (+0100) Subject: CLEANUP: map: Avoid memory leak in out-of-memory condition. X-Git-Tag: v1.7-dev2~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78f3595f4d31e3b1d662a5c023887ac8e3182585;p=thirdparty%2Fhaproxy.git CLEANUP: map: Avoid memory leak in out-of-memory condition. This memory leak of about 100 bytes occurs only if there is an error condidtion during evaluation of a "map" directive in the configuration file. This evaluation only happens once on startup because haproxy does not have a mechanism for re-loading the configuration file during run-time. The startup will be aborted anyway due to error conditions raised. Nevertheless fix it to silence warnings of static code analysis tools and be safe against future revisions of the code. Found in haproxy 1.5.14. --- diff --git a/src/map.c b/src/map.c index a28cedae92..ac1c00ab16 100644 --- a/src/map.c +++ b/src/map.c @@ -126,6 +126,7 @@ int sample_load_map(struct arg *arg, struct sample_conv *conv, default: memprintf(err, "map: internal haproxy error: no default parse case for the input type <%d>.", conv->out_type); + free(desc); return 0; }