policycoreutils: free memory of allocated context in run_init
Found by scan-build. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
parent
d8b9bd5c2a
commit
f0c354afc0
1 changed files with 5 additions and 0 deletions
|
@ -406,14 +406,19 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (chdir("/")) {
|
||||
perror("chdir");
|
||||
free(new_context);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (setexeccon(new_context) < 0) {
|
||||
fprintf(stderr, _("Could not set exec context to %s.\n"),
|
||||
new_context);
|
||||
free(new_context);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
free(new_context);
|
||||
|
||||
if (access("/usr/sbin/open_init_pty", X_OK) != 0) {
|
||||
if (execvp(argv[1], argv + 1)) {
|
||||
perror("execvp");
|
||||
|
|
Loading…
Reference in a new issue