diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c index 9dffbc7360866147a437966ec63d6bd5b6fb280a..95b527436851571fbb8c2de8df7d93197b5cceee 100644 --- a/src/util/virsocketaddr.c +++ b/src/util/virsocketaddr.c @@ -417,8 +417,10 @@ virSocketAddrFormatFull(const virSocketAddr *addr, if (virAsprintf(&addrstr, "%s%s%s", ipv6_host ? ipv6_host : host, - separator ? separator : ":", port) == -1) + separator ? separator : ":", port) == -1) { + VIR_FREE(ipv6_host); goto error; + } VIR_FREE(ipv6_host); } else {