]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: commit 196729ef used wrong condition resulting in freeing constants
authorWilly Tarreau <w@1wt.eu>
Fri, 1 Jun 2012 08:58:06 +0000 (10:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Jun 2012 08:58:06 +0000 (10:58 +0200)
Recent commit 196729ef had inverted condition to free format strings. No
backport is needed, it was never released.

src/cfgparse.c
src/haproxy.c

index 5f8cb9675fa259eee3ca8e4952006c920e028e1b..a95f06c801055d80166dc7fb064ae73cf5e5fd40 100644 (file)
@@ -1610,9 +1610,9 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                free(defproxy.expect_str);
                if (defproxy.expect_regex) regfree(defproxy.expect_regex);
 
-               if (defproxy.logformat_string == default_http_log_format ||
-                   defproxy.logformat_string == default_tcp_log_format ||
-                   defproxy.logformat_string == clf_http_log_format)
+               if (defproxy.logformat_string != default_http_log_format &&
+                   defproxy.logformat_string != default_tcp_log_format &&
+                   defproxy.logformat_string != clf_http_log_format)
                        free(defproxy.logformat_string);
 
                free(defproxy.uniqueid_format_string);
index 48c343344a53773cc49c92644628b747fe1f2c93..cede41ca65293fe67946685b09e1a1addd9cd8de 100644 (file)
@@ -830,9 +830,9 @@ void deinit(void)
                free(p->capture_name);
                free(p->monitor_uri);
                free(p->rdp_cookie_name);
-               if (p->logformat_string == default_http_log_format ||
-                   p->logformat_string == default_tcp_log_format ||
-                   p->logformat_string == clf_http_log_format)
+               if (p->logformat_string != default_http_log_format &&
+                   p->logformat_string != default_tcp_log_format &&
+                   p->logformat_string != clf_http_log_format)
                        free(p->logformat_string);
 
                free(p->uniqueid_format_string);