coverity: #1425921

free allocated memory Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent e89919e3
......@@ -591,6 +591,7 @@ static char *lxc_attach_getpwshell(uid_t uid)
if (waitpid(pid, &status, 0) < 0) {
if (errno == EINTR)
goto again;
free(result);
return NULL;
}
......@@ -599,14 +600,20 @@ static char *lxc_attach_getpwshell(uid_t uid)
* don't.
*/
if (!WIFEXITED(status))
if (!WIFEXITED(status)) {
free(result);
return NULL;
}
if (WEXITSTATUS(status) != 0)
if (WEXITSTATUS(status) != 0) {
free(result);
return NULL;
}
if (!found)
if (!found) {
free(result);
return NULL;
}
return result;
} else {
......
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