mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
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:
1 parent
da66099b8b
commit
6aef0ff045
1 file changed
+3
-1
@@ -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:
|
||||
|
||||