Hi Paolo,

On 6/24/20 4:12 PM, Paolo Bonzini wrote:
> On 24/06/20 14:43, Eric Auger wrote:
>> +    op = object_property_try_add(obj, name, type, object_get_child_property,
>> +                                 NULL, object_finalize_child_property,
>> +                                 child, errp);
>> +    if (!op) {
>> +        goto out;
>> +    }
>>      op->resolve = object_resolve_child_property;
>> +out:
>>      object_ref(child);
>>      child->parent = obj;
>>      return op;
> 
> I think if there's an error you need to return NULL without ref-ing
> child, shouldn't you?
hum yes you're fully right, the out label is badly placed.
> 
> You can then add another test that object_property_add_child succeeds
> after object_property_try_add_child fails.
OK

Thanks

Eric
> 
> Paolo
> 


Reply via email to