[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 30/30] migration: fix id leak regression
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v2 30/30] migration: fix id leak regression |
Date: |
Wed, 22 Feb 2017 08:41:16 +0000 |
Hi
On Tue, Feb 21, 2017 at 9:43 PM Philippe Mathieu-Daudé <address@hidden>
wrote:
> Hi Marc-André,
>
> There is no documentation in "hw/qdev-core.h" for qdev_get_dev_path()
> and his name doesn't suggest any Heap allocation (like many others).
> Is there a recommended way in Qemu codebase to give to the user/caller a
> hit to care about releasing memory? "Learn to Read the Source, Luke."
>
Not much hint, except that the returned value is not const. But I did
verify this when I wrote the patch.
thanks
> On 02/21/2017 11:19 AM, Dr. David Alan Gilbert wrote:
> > * Marc-André Lureau (address@hidden) wrote:
> >> This leak was introduced in commit
> >> 581f08bac22bdd5e081ae07f68071a0fc3c5c2c7.
> >>
> >> (it stands out quickly with ASAN once the rest of the leaks are also
> >> removed from make check with this series)
> >
> > Oops yes.
> >
> > Reviewed-by: Dr. David Alan Gilbert <address@hidden>
>
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
>
> >
> >>
> >> Cc: Dr. David Alan Gilbert <address@hidden>
> >> Cc: Juan Quintela <address@hidden>
> >> Signed-off-by: Marc-André Lureau <address@hidden>
> >> ---
> >> migration/savevm.c | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/migration/savevm.c b/migration/savevm.c
> >> index 5ecd264134..87c7a00832 100644
> >> --- a/migration/savevm.c
> >> +++ b/migration/savevm.c
> >> @@ -688,6 +688,7 @@ int vmstate_register_with_alias_id(DeviceState
> *dev, int instance_id,
> >>
> >> return -1;
> >> }
> >> + g_free(id);
> >>
> >> se->compat = g_new0(CompatEntry, 1);
> >> pstrcpy(se->compat->idstr, sizeof(se->compat->idstr),
> vmsd->name);
> >> --
> >> 2.11.0.295.gd7dffce1c.dirty
> >>
> > --
> > Dr. David Alan Gilbert / address@hidden / Manchester, UK
> >
>
> --
Marc-André Lureau
- Re: [Qemu-devel] [PATCH v2 26/30] tests: allows to run single test in usb-hcd-ehci-test, (continued)
- [Qemu-devel] [PATCH v2 25/30] usb: release the created buses, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 27/30] tests: fix usb-test leaks, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 28/30] tests: add specialized device_find function, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 30/30] migration: fix id leak regression, Marc-André Lureau, 2017/02/21
- Re: [Qemu-devel] [PATCH v2 30/30] migration: fix id leak regression, Dr. David Alan Gilbert, 2017/02/28
- [Qemu-devel] [PATCH v2 29/30] tests: fix virtio-blk-test leaks, Marc-André Lureau, 2017/02/21
- Re: [Qemu-devel] [PATCH v2 00/30] Various memory leak fixes, Marc-André Lureau, 2017/02/27