aboutsummaryrefslogtreecommitdiff
path: root/migration/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'migration/socket.c')
-rw-r--r--migration/socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/migration/socket.c b/migration/socket.c
index dc88812048..5fdc723ca3 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -27,10 +27,11 @@
static SocketAddress *tcp_build_address(const char *host_port, Error **errp)
{
- InetSocketAddress *iaddr = inet_parse(host_port, errp);
+ InetSocketAddress *iaddr = g_new(InetSocketAddress, 1);
SocketAddress *saddr;
- if (!iaddr) {
+ if (inet_parse(iaddr, host_port, errp)) {
+ qapi_free_InetSocketAddress(iaddr);
return NULL;
}