qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] migration: Plug memory leak on HMP migrate error path


From: Peter Maydell
Subject: Re: [PATCH] migration: Plug memory leak on HMP migrate error path
Date: Tue, 23 Jan 2024 16:33:43 +0000

On Wed, 17 Jan 2024 at 19:49, Markus Armbruster <armbru@redhat.com> wrote:
>
> hmp_migrate() leaks @caps when qmp_migrate() fails.  Plug the leak
> with g_autoptr().
>
> Fixes: 967f2de5c9ec (migration: Implement MigrateChannelList to hmp migration 
> flow.) v8.2.0-rc0
> Fixes: CID 1533124

Isn't this 1533125 ? 1533124 is a false positive in
the migrate_mode() function.

> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  migration/migration-hmp-cmds.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c
> index 740a219aa4..99b49df5dd 100644
> --- a/migration/migration-hmp-cmds.c
> +++ b/migration/migration-hmp-cmds.c
> @@ -764,7 +764,7 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
>      bool resume = qdict_get_try_bool(qdict, "resume", false);
>      const char *uri = qdict_get_str(qdict, "uri");
>      Error *err = NULL;
> -    MigrationChannelList *caps = NULL;
> +    g_autoptr(MigrationChannelList) caps = NULL;
>      g_autoptr(MigrationChannel) channel = NULL;
>
>      if (inc) {
> @@ -789,8 +789,6 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
>          return;
>      }
>
> -    qapi_free_MigrationChannelList(caps);
> -
>      if (!detach) {
>          HMPMigrationStatus *status;

thanks
-- PMM



reply via email to

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