aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/qemu-sockets.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index d8183f7..b39ae74 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -1338,12 +1338,14 @@ char *socket_address_to_string(struct SocketAddress *addr, Error **errp)
SocketAddress *socket_address_flatten(SocketAddressLegacy *addr_legacy)
{
- SocketAddress *addr = g_new(SocketAddress, 1);
+ SocketAddress *addr;
if (!addr_legacy) {
return NULL;
}
+ addr = g_new(SocketAddress, 1);
+
switch (addr_legacy->type) {
case SOCKET_ADDRESS_LEGACY_KIND_INET:
addr->type = SOCKET_ADDRESS_TYPE_INET;