From: zhanghailiang Date: Fri, 14 Nov 2014 01:39:23 +0000 (+0800) Subject: l2tpv3: fix possible double free X-Git-Tag: v2.1.3~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05c5febf8cfe4e6f11a2c5147e13443ce3e9ba52;p=thirdparty%2Fqemu.git l2tpv3: fix possible double free freeaddrinfo(result) does not assign result = NULL, after frees it. There will be a double free when it goes error case. It is reported by covertiy. Reviewed-by: Gonglei Cc: qemu-stable@nongnu.org Signed-off-by: zhanghailiang Signed-off-by: Paolo Bonzini (cherry picked from commit 77374582ab961af2c5e702f767f52179d5f7676c) Signed-off-by: Michael Roth --- diff --git a/net/l2tpv3.c b/net/l2tpv3.c index 528d95b6416..65db5ef279c 100644 --- a/net/l2tpv3.c +++ b/net/l2tpv3.c @@ -660,7 +660,6 @@ int net_init_l2tpv3(const NetClientOptions *opts, if (fd == -1) { fd = -errno; error_report("l2tpv3_open : socket creation failed, errno = %d", -fd); - freeaddrinfo(result); goto outerr; } if (bind(fd, (struct sockaddr *) result->ai_addr, result->ai_addrlen)) {