shared/misc.c: free env_allow if returning early from env_filter

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James 2022-03-29 09:06:19 +01:00 committed by William Hubbs
parent 7b2e8f9efd
commit c47b37ea68

View File

@ -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 */