mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
Fix memory leak in __virExec
Commit e0d014f237
made binary potentially allocated on the heap.
It was freed in the parent in the error path, but not in the success path
that doesn't goto the cleanup label.
Found by 'make -C tests valgrind'.
This commit is contained in:
parent
701bee0193
commit
9d50b323a9
@ -568,6 +568,10 @@ __virExec(const char *const*argv,
|
||||
}
|
||||
|
||||
*retpid = pid;
|
||||
|
||||
if (binary != argv[0])
|
||||
VIR_FREE(binary);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user