[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] qtest: fix qtest_qmp_device_add leak
From: |
Marc-André Lureau |
Subject: |
Re: [PATCH 2/3] qtest: fix qtest_qmp_device_add leak |
Date: |
Fri, 8 Nov 2019 00:41:16 +0400 |
Hi
On Fri, Nov 8, 2019 at 12:31 AM Laurent Vivier <address@hidden> wrote:
>
> On 07/11/2019 20:27, Marc-André Lureau wrote:
> > Spotted by ASAN.
> >
> > Signed-off-by: Marc-André Lureau <address@hidden>
> > ---
> > tests/libqtest.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/tests/libqtest.c b/tests/libqtest.c
> > index 3706bccd8d..91e9cb220c 100644
> > --- a/tests/libqtest.c
> > +++ b/tests/libqtest.c
> > @@ -1274,6 +1274,7 @@ void qtest_qmp_device_add(QTestState *qts, const char
> > *driver, const char *id,
> > qdict_put_str(args, "id", id);
> >
> > qtest_qmp_device_add_qdict(qts, driver, args);
> > + qobject_unref(args);
> > }
> >
> > static void device_deleted_cb(void *opaque, const char *name, QDict *data)
> >
>
> Stupid question: where is the qobject_ref()?
The initial ref is from qobject_from_vjsonf_nofail() constructor
--
Marc-André Lureau
- [PATCH 0/3] Some memory leak fixes, Marc-André Lureau, 2019/11/07
- [PATCH 1/3] virtio-input: fix memory leak on unrealize, Marc-André Lureau, 2019/11/07
- [PATCH 2/3] qtest: fix qtest_qmp_device_add leak, Marc-André Lureau, 2019/11/07
- [PATCH 3/3] cpu-plug-test: fix leaks, Marc-André Lureau, 2019/11/07
- Re: [PATCH 0/3] Some memory leak fixes, no-reply, 2019/11/07
- Re: [PATCH 0/3] Some memory leak fixes, Michael S. Tsirkin, 2019/11/08