From: Christopher Faulet Date: Wed, 18 Sep 2019 09:18:33 +0000 (+0200) Subject: BUG/MINOR: mux-fcgi: Don't compare the filter name in its parsing callback X-Git-Tag: v2.1-dev2~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ce57b05de9a6ed316753ab8cd060390f4b89b62;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-fcgi: Don't compare the filter name in its parsing callback The function parse_fcgi_flt() is called when the keyword "fcgi-app" is found on a filter line. We don't need to compare it again in the function. This patch fixes the issue #284. No backport needed. --- diff --git a/src/fcgi-app.c b/src/fcgi-app.c index aeda8216b0..1c1573c252 100644 --- a/src/fcgi-app.c +++ b/src/fcgi-app.c @@ -525,18 +525,17 @@ parse_fcgi_flt(char **args, int *cur_arg, struct proxy *px, int pos = *cur_arg; /* Get the fcgi-app name*/ - if (!strcmp(args[pos], "fcgi-app")) { - if (!*args[pos + 1]) { - memprintf(err, "%s : expects a argument", args[pos]); - goto err; - } - name = strdup(args[pos + 1]); - if (!name) { - memprintf(err, "%s '%s' : out of memory", args[pos], args[pos + 1]); - goto err; - } - pos += 2; + if (!*args[pos + 1]) { + memprintf(err, "%s : expects a argument", args[pos]); + goto err; + } + name = strdup(args[pos + 1]); + if (!name) { + memprintf(err, "%s '%s' : out of memory", args[pos], args[pos + 1]); + goto err; } + pos += 2; + /* Check if an fcgi-app filter with the same name already exists */ list_for_each_entry_safe(f, back, &px->filter_configs, list) { if (f->id != fcgi_flt_id) @@ -575,7 +574,6 @@ parse_fcgi_flt(char **args, int *cur_arg, struct proxy *px, return 0; err: free(name); - //free(fcgi_conf); return -1; }