From 6920de7e4cc44f19b8b467560e853202bbe49fa1 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 19 Dec 2018 10:40:07 +0100 Subject: utils: Free args in __fw3_command_pipe() args was not freed after leaving this function. Fixes Coverity issue 1412470 Resource leak Signed-off-by: Hauke Mehrtens Acked-by: Jo-Philipp Wich --- utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils.c b/utils.c index 4f892a7..684b2c3 100644 --- a/utils.c +++ b/utils.c @@ -252,6 +252,7 @@ __fw3_command_pipe(bool silent, const char *command, ...) switch ((pid = fork())) { case -1: + free(args); return false; case 0: @@ -275,6 +276,7 @@ __fw3_command_pipe(bool silent, const char *command, ...) } pipe_fd = fdopen(pfds[1], "w"); + free(args); return true; } -- cgit v1.2.1