xl: free pid string in do_daemonize

Pid is a null terminated string allocated by asprintf. It should be
freed after use.

Also fixed a coding style problem while I was there.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Wei Liu authored and Ian Campbell committed 2015-07-24 11:27:52 +01:00
1 parent da66099b8b
commit 6aef0ff045
1 file changed
+3 -1
+3 -1
View File
@@ -524,10 +524,12 @@ static int do_daemonize(char *name, const char *pidfile)
exit(1);
}
if ( close(fd) < 0 ) {
if (close(fd) < 0) {
perror("Closing pidfile");
exit(1);
}
free(pid);
}
out:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.