Skip to content

Commit

Permalink
l2tpv3: fix possible double free
Browse files Browse the repository at this point in the history
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 7737458)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
colo-ft authored and mdroth committed Jan 7, 2015
1 parent de98dc9 commit 05c5feb
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion net/l2tpv3.c
Expand Up @@ -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)) {
Expand Down

0 comments on commit 05c5feb

Please sign in to comment.