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

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



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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