[libvirt] [PATCH v4 01/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/conf/*

Eric Blake eblake at redhat.com
Tue May 21 17:31:56 UTC 2013


On 05/21/2013 03:14 AM, Michal Privoznik wrote:
>>> @@ -392,17 +392,14 @@ virCapabilitiesAddGuest(virCapsPtr caps,
>>>      if (VIR_ALLOC(guest) < 0)
>>>          goto no_memory;
>>>  
>>> -    if ((guest->ostype = strdup(ostype)) == NULL)
>>> +    if (VIR_STRDUP(guest->ostype, ostype) < 0)
>>>          goto no_memory;
>>
>> Local double-oom.  You might want to clean this one up now.
> 
> You mean s/no_memory/error/ ? Because even if the label is called
> no_memory not every label does call virReportOOMError(), like in this case.

Ah, now that I look at the label, you're right!

Yes, s/no_memory/error/ would avoid my confusion (generally, I've been
assuming that a no_memory label implied an OOM report).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130521/32ba8bab/attachment-0001.sig>


More information about the libvir-list mailing list