aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-03-29 09:06:19 +0100
committerWilliam Hubbs <w.d.hubbs@gmail.com>2022-05-08 14:56:26 -0500
commitc47b37ea68be62e527a342c5f2bf91538dbc9653 (patch)
treeced8642650459a1fe732433a8b1235a9260788c0
parent7b2e8f9efd28566133b0da5ccf91b0e24a0d6c15 (diff)
shared/misc.c: free env_allow if returning early from env_filter
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--src/shared/misc.c4
1 files changed, 3 insertions, 1 deletions
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 */