Re: [PATCH] Fix memory leak in __virExec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/4/30 Eric Blake <eblake@xxxxxxxxxx>:
> On 04/30/2011 05:11 AM, Matthias Bolte wrote:
>> Commit e0d014f2379dd 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'.
>> ---
>> Âsrc/util/util.c | Â Â4 ++++
>> Â1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/util/util.c b/src/util/util.c
>> index c337aa9..37472bb 100644
>> --- a/src/util/util.c
>> +++ b/src/util/util.c
>> @@ -568,6 +568,10 @@ __virExec(const char *const*argv,
>> Â Â Â Â Â}
>>
>> Â Â Â Â Â*retpid = pid;
>> +
>> + Â Â Â Âif (binary != argv[0])
>> + Â Â Â Â Â ÂVIR_FREE(binary);
>
> ACK.
>

Thanks, pushed.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]