From c47b37ea68be62e527a342c5f2bf91538dbc9653 Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 29 Mar 2022 09:06:19 +0100 Subject: [PATCH] shared/misc.c: free env_allow if returning early from env_filter Signed-off-by: Sam James --- src/shared/misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/misc.c b/src/shared/misc.c index d8e4d5e6..a83599e5 100644 --- a/src/shared/misc.c +++ b/src/shared/misc.c @@ -74,8 +74,10 @@ env_filter(void) * If '*' is an entry in rc_env_allow, do nothing as we are to pass * through all environment variables. */ - if (rc_stringlist_find(env_allow, "*")) + if (rc_stringlist_find(env_allow, "*")) { + rc_stringlist_free(env_allow); return; + } profile = rc_config_load(RC_PROFILE_ENV); /* Copy the env and work from this so we can manipulate it safely */