mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-30 21:42:06 -06:00
migration: free addr in the same function that we created it
Otherwise, we can't use it after calling socket_start_incoming_migration Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
6f0f642835
commit
9102d27e33
1 changed files with 2 additions and 2 deletions
|
@ -172,7 +172,6 @@ static void socket_start_incoming_migration(SocketAddress *saddr,
|
||||||
|
|
||||||
if (qio_channel_socket_listen_sync(listen_ioc, saddr, errp) < 0) {
|
if (qio_channel_socket_listen_sync(listen_ioc, saddr, errp) < 0) {
|
||||||
object_unref(OBJECT(listen_ioc));
|
object_unref(OBJECT(listen_ioc));
|
||||||
qapi_free_SocketAddress(saddr);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +180,6 @@ static void socket_start_incoming_migration(SocketAddress *saddr,
|
||||||
socket_accept_incoming_migration,
|
socket_accept_incoming_migration,
|
||||||
listen_ioc,
|
listen_ioc,
|
||||||
(GDestroyNotify)object_unref);
|
(GDestroyNotify)object_unref);
|
||||||
qapi_free_SocketAddress(saddr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tcp_start_incoming_migration(const char *host_port, Error **errp)
|
void tcp_start_incoming_migration(const char *host_port, Error **errp)
|
||||||
|
@ -191,6 +189,7 @@ void tcp_start_incoming_migration(const char *host_port, Error **errp)
|
||||||
if (!err) {
|
if (!err) {
|
||||||
socket_start_incoming_migration(saddr, &err);
|
socket_start_incoming_migration(saddr, &err);
|
||||||
}
|
}
|
||||||
|
qapi_free_SocketAddress(saddr);
|
||||||
error_propagate(errp, err);
|
error_propagate(errp, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,4 +197,5 @@ void unix_start_incoming_migration(const char *path, Error **errp)
|
||||||
{
|
{
|
||||||
SocketAddress *saddr = unix_build_address(path);
|
SocketAddress *saddr = unix_build_address(path);
|
||||||
socket_start_incoming_migration(saddr, errp);
|
socket_start_incoming_migration(saddr, errp);
|
||||||
|
qapi_free_SocketAddress(saddr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue