All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] l2tpv3: fix possible double free
@ 2014-11-14  1:39 ` zhanghailiang
  0 siblings, 0 replies; 8+ messages in thread
From: zhanghailiang @ 2014-11-14  1:39 UTC (permalink / raw)
  To: qemu-trivial; +Cc: zhanghailiang, qemu-devel, stefanha, peter.huangpeng

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.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
---
 net/l2tpv3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 528d95b..f9e0c98 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -661,6 +661,7 @@ int net_init_l2tpv3(const NetClientOptions *opts,
         fd = -errno;
         error_report("l2tpv3_open : socket creation failed, errno = %d", -fd);
         freeaddrinfo(result);
+        result = NULL;
         goto outerr;
     }
     if (bind(fd, (struct sockaddr *) result->ai_addr, result->ai_addrlen)) {
-- 
1.7.12.4




^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-11-17  5:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-14  1:39 [Qemu-trivial] [PATCH] l2tpv3: fix possible double free zhanghailiang
2014-11-14  1:39 ` [Qemu-devel] " zhanghailiang
2014-11-14  3:03 ` [Qemu-trivial] " Gonglei
2014-11-14  3:03   ` Gonglei
2014-11-14  8:45 ` [Qemu-trivial] " Paolo Bonzini
2014-11-14  8:45   ` [Qemu-devel] " Paolo Bonzini
2014-11-17  5:13   ` [Qemu-trivial] " zhanghailiang
2014-11-17  5:13     ` [Qemu-devel] " zhanghailiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.