]> git.proxmox.com Git - mirror_qemu.git/commit - migration/migration.c
migration: Plug memory leak with migration URIs
authorHet Gala <het.gala@nutanix.com>
Wed, 29 Nov 2023 20:43:01 +0000 (20:43 +0000)
committerPeter Xu <peterx@redhat.com>
Fri, 1 Dec 2023 16:01:28 +0000 (11:01 -0500)
commitbc1d54ee51367955b50786323ee5a6bd8c0f0034
treec867e3f2973d28a298988ef4d22573da41df5f17
parentabf635ddfe3242df907f58967f3c1e6763bbca2d
migration: Plug memory leak with migration URIs

migrate_uri_parse() allocates memory to 'channel' if the user
opts for old syntax - uri, which is leaked because there is no
code for freeing 'channel'.
So, free channel to avoid memory leak in case where 'channels'
is empty and uri parsing is required.

Fixes: 5994024f ("migration: Implement MigrateChannelList to qmp migration flow")
Signed-off-by: Het Gala <het.gala@nutanix.com>
Suggested-by: Markus Armbruster <armbru@redhat.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Link: https://lore.kernel.org/r/20231129204301.131228-1-het.gala@nutanix.com
Signed-off-by: Peter Xu <peterx@redhat.com>
migration/migration.c