Commit a9cab7e3 by Christian Seiler Committed by Serge Hallyn

attach: Fix minor memory leak in environment variable handling

parent 55c76589
...@@ -295,7 +295,13 @@ int lxc_attach_set_environment(enum lxc_attach_env_policy_t policy, char** extra ...@@ -295,7 +295,13 @@ int lxc_attach_set_environment(enum lxc_attach_env_policy_t policy, char** extra
} }
if (clearenv()) { if (clearenv()) {
char **p;
SYSERROR("failed to clear environment"); SYSERROR("failed to clear environment");
if (extra_keep_store) {
for (p = extra_keep_store; *p; p++)
free(*p);
free(extra_keep_store);
}
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment