From e4f6bfd6fec87e8eb77f1a9fe34b8b7884ef9748 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 22 Jul 2017 03:04:20 +0200 Subject: zcip: fix slow environment leak Signed-off-by: Denys Vlasenko --- networking/ifplugd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'networking/ifplugd.c') diff --git a/networking/ifplugd.c b/networking/ifplugd.c index c36bc9524..9bc1a075f 100644 --- a/networking/ifplugd.c +++ b/networking/ifplugd.c @@ -342,10 +342,8 @@ static int run_script(const char *action) /* r < 0 - can't exec, 0 <= r < 0x180 - exited, >=0x180 - killed by sig (r-0x180) */ r = spawn_and_wait(argv); - unsetenv(IFPLUGD_ENV_PREVIOUS); - unsetenv(IFPLUGD_ENV_CURRENT); - free(env_PREVIOUS); - free(env_CURRENT); + bb_unsetenv_and_free(env_PREVIOUS); + bb_unsetenv_and_free(env_CURRENT); bb_error_msg("exit code: %d", r & 0xff); return (option_mask32 & FLAG_IGNORE_RETVAL) ? 0 : r; -- cgit v1.2.3