From: Willy Tarreau Date: Tue, 5 Jan 2021 14:58:37 +0000 (+0100) Subject: CLEANUP: mworker: remove duplicate pointer tests in cfg_parse_program() X-Git-Tag: v2.4-dev5~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f7efcddd6bd389e5e2c49f8f554d85d085720f2;p=thirdparty%2Fhaproxy.git CLEANUP: mworker: remove duplicate pointer tests in cfg_parse_program() As reported in issue #1017, there are two harmless duplicate tests in cfg_parse_program(), one made of a "if" using the same condition as the loop it's in, and the other one being a null test before a free. This just removes them. No backport is needed. --- diff --git a/src/mworker-prog.c b/src/mworker-prog.c index 8d404cb519..acf84b0e4e 100644 --- a/src/mworker-prog.c +++ b/src/mworker-prog.c @@ -307,18 +307,14 @@ error: int i; for (i = 0; ext_child->command[i]; i++) { - if (ext_child->command[i]) { - free(ext_child->command[i]); - ext_child->command[i] = NULL; - } + free(ext_child->command[i]); + ext_child->command[i] = NULL; } free(ext_child->command); ext_child->command = NULL; } - if (ext_child->id) { - free(ext_child->id); - ext_child->id = NULL; - } + free(ext_child->id); + ext_child->id = NULL; } free(ext_child);