mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
commandhelper: Use automatic memory management in printCwd
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
0793d15685
commit
99502fa790
@ -194,7 +194,7 @@ static void printDaemonization(FILE *log, struct Arguments *args)
|
||||
|
||||
static int printCwd(FILE *log)
|
||||
{
|
||||
char *cwd = NULL;
|
||||
cleanup(char *, cleanupGeneric) cwd = NULL;
|
||||
char *display;
|
||||
|
||||
if (!(cwd = getcwd(NULL, 0)))
|
||||
@ -213,7 +213,6 @@ static int printCwd(FILE *log)
|
||||
# endif
|
||||
|
||||
fprintf(log, "CWD:%s\n", display);
|
||||
free(cwd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user