mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -568,6 +568,10 @@ __virExec(const char *const*argv,
|
||||
}
|
||||
|
||||
*retpid = pid;
|
||||
|
||||
if (binary != argv[0])
|
||||
VIR_FREE(binary);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user