From 5302bee850baf0e6908c90ea2b5de6143f86ac69 Mon Sep 17 00:00:00 2001 From: Maximilian Wilhelm Date: Tue, 6 Oct 2020 03:26:14 +0200 Subject: [PATCH] lifecycle: Don't leak allocated memory. Signed-off-by: Maximilian Wilhelm --- libifupdown/lifecycle.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libifupdown/lifecycle.c b/libifupdown/lifecycle.c index d39afab..3da5dae 100644 --- a/libifupdown/lifecycle.c +++ b/libifupdown/lifecycle.c @@ -231,6 +231,10 @@ build_environment(char **envp[], const struct lif_execute_opts *opts, const stru lif_environment_push(envp, "IF_ADDRESSES", addresses); if (gateways != NULL) lif_environment_push(envp, "IF_GATEWAYS", gateways); + + /* Clean up */ + free (addresses); + free (gateways); } bool