]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: config: free peer's address when exiting upon parsing error
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Jan 2013 23:29:37 +0000 (00:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 15:19:18 +0000 (16:19 +0100)
An error caused by an invalid port does not cause the raddr string to
be freed. This is harmless at the moment since we exit, but may have
an impact later if we ever support hot config changes.

Reported-by: Dinko Korunic <dkorunic@reflected.net>
src/cfgparse.c

index bbf0da2899b799211614b1dfd154b56613043ebd..718664c0f5e3431774d5a224bc0542eae15f6c17 100644 (file)
@@ -1509,6 +1509,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
                if (!realport) {
                        Alert("parsing [%s:%d] : Missing or invalid port in '%s'\n", file, linenum, args[2]);
                        err_code |= ERR_ALERT | ERR_FATAL;
+                       free(raddr);
                        goto out;
                }