Re: [PATCH v2] storage: Avoid memory leak on metadata fetching

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

 



On 07/14/2011 06:23 AM, Jiri Denemark wrote:
>> +void ATTRIBUTE_NONNULL(1)
>> +virStorageFileFreeMetadata(virStorageFileMetadata *meta)
>> +{
>> +    VIR_FREE(meta->backingStore);
>> +    VIR_FREE(meta);
>> +}
> 
> We like having free-like functions to work with NULL arguments, shouldn't we
> follow that habit here as well?

Yes - add:

if (!meta)
    return;

here, and update cfg.mk to list virStorageFileFreeMetadata in the list
of free-like functions.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]