diff options
author | zhanghailiang <zhang.zhanghailiang@huawei.com> | 2014-11-14 09:39:23 +0800 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2015-01-07 14:45:28 -0600 |
commit | 05c5febf8cfe4e6f11a2c5147e13443ce3e9ba52 (patch) | |
tree | 388985466e34adbd5505eb98cf42dd7db461455a | |
parent | de98dc9539e31b8f986e5d7aad22988beecc2028 (diff) | |
download | qemu-05c5febf8cfe4e6f11a2c5147e13443ce3e9ba52.tar.gz |
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 <arei.gonglei@huawei.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 77374582ab961af2c5e702f767f52179d5f7676c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | net/l2tpv3.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/l2tpv3.c b/net/l2tpv3.c index 528d95b641..65db5ef279 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)) { |