qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] tests: check-qom-proplist: fix leak


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH] tests: check-qom-proplist: fix leak
Date: Fri, 09 Jun 2017 17:34:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 06/09/2017 08:33 AM, Marc-André Lureau wrote:
>> user_creatable_add_opts() returns a reference (the other reference is
>> for the root parent/child link).
>> 
>> Leak introduced in commit a1af255f065cc.
>> 
>> Signed-off-by: Marc-André Lureau <address@hidden>
>> ---
>>  tests/check-qom-proplist.c | 2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/tests/check-qom-proplist.c b/tests/check-qom-proplist.c
>> index 8e432e9ab6..a3cd7ab29f 100644
>> --- a/tests/check-qom-proplist.c
>> +++ b/tests/check-qom-proplist.c
>> @@ -428,6 +428,8 @@ static void test_dummy_createcmdl(void)
>>      g_assert(err == NULL);
>>      error_free(err);
>>  
>> +    object_unref(OBJECT(dobj));
>
> This should be spelled QDECREF(dobj);

Caution, this is object_unref(), not qobject_decref().

We suck at naming.

> (Hmm - maybe scripts/coccinelle/qobject.cocci should be taught this
> cleanup pattern...)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]