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:
Matthias Bolte 2011-04-30 12:06:29 +02:00
parent 701bee0193
commit 9d50b323a9

View File

@ -568,6 +568,10 @@ __virExec(const char *const*argv,
}
*retpid = pid;
if (binary != argv[0])
VIR_FREE(binary);
return 0;
}