diff --git a/src/mgmt/cli_mgmt.c b/src/mgmt/cli_mgmt.c index 8c8b43cffda..99a5457746d 100644 --- a/src/mgmt/cli_mgmt.c +++ b/src/mgmt/cli_mgmt.c @@ -240,6 +240,7 @@ get_env_deprecated(char **val, const char *new_env, const char *old_env) D_WARN("Both %s and %s are set! Deprecated %s (%s) will be ignored\n", new_env, old_env, old_env, old); *val = new; + d_freeenv_str(&old); return 0; } @@ -247,6 +248,7 @@ get_env_deprecated(char **val, const char *new_env, const char *old_env) D_INFO("%s is deprecated, upgrade your environment to use %s instead\n", old_env, new_env); *val = old; + d_freeenv_str(&new); return 0; }