From 8f7efcddd6bd389e5e2c49f8f554d85d085720f2 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 5 Jan 2021 15:58:37 +0100 Subject: [PATCH] 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. --- src/mworker-prog.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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); -- 2.47.3