From 39b0665bc7d25f7389d944599bcbcff7513f1e7e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 1 Jun 2012 10:58:06 +0200 Subject: [PATCH] BUG/MINOR: commit 196729ef used wrong condition resulting in freeing constants Recent commit 196729ef had inverted condition to free format strings. No backport is needed, it was never released. --- src/cfgparse.c | 6 +++--- src/haproxy.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index 5f8cb9675..a95f06c80 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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); diff --git a/src/haproxy.c b/src/haproxy.c index 48c343344..cede41ca6 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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);