mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
daemon: Fix memory leak in 'initrd-cat' (found by valgrind).
(cherry picked from commit 84242a8d0b)
This commit is contained in:
@@ -108,9 +108,11 @@ do_initrd_cat (const char *path, const char *filename, size_t *size_r)
|
||||
int r = system (cmd);
|
||||
if (r == -1) {
|
||||
reply_with_perror ("command failed: %s", cmd);
|
||||
free (cmd);
|
||||
rmdir (tmpdir);
|
||||
return NULL;
|
||||
}
|
||||
free (cmd);
|
||||
if (WEXITSTATUS (r) != 0) {
|
||||
reply_with_perror ("command failed with return code %d",
|
||||
WEXITSTATUS (r));
|
||||
|
||||
Reference in New Issue
Block a user