mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35: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)
|
static int printCwd(FILE *log)
|
||||||
{
|
{
|
||||||
char *cwd = NULL;
|
cleanup(char *, cleanupGeneric) cwd = NULL;
|
||||||
char *display;
|
char *display;
|
||||||
|
|
||||||
if (!(cwd = getcwd(NULL, 0)))
|
if (!(cwd = getcwd(NULL, 0)))
|
||||||
@ -213,7 +213,6 @@ static int printCwd(FILE *log)
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
fprintf(log, "CWD:%s\n", display);
|
fprintf(log, "CWD:%s\n", display);
|
||||||
free(cwd);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user