提交 9f4c39f3 编写于 作者: Y Yi Wang 提交者: Erik Skultety

util: fix memory leak in virSocketAddrFormatFull

The @ipv6_host allocated in virAsprintf may be lost when virAsprintf
addrstr failed.
Signed-off-by: NYi Wang <wang.yi59@zte.com.cn>
Signed-off-by: NErik Skultety <eskultet@redhat.com>
上级 7693f07f
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册