qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 02/12] l2tpv3: fix possible double free


From: Paolo Bonzini
Subject: [Qemu-devel] [PULL 02/12] l2tpv3: fix possible double free
Date: Mon, 17 Nov 2014 18:08:09 +0100

From: zhanghailiang <address@hidden>

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 <address@hidden>
Cc: address@hidden
Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 net/l2tpv3.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 528d95b..65db5ef 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)) {
-- 
1.8.3.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]