Skip to content

Commit 05c5feb

Browse files
colo-ftmdroth
authored andcommitted
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 <[email protected]> Cc: [email protected] Signed-off-by: zhanghailiang <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> (cherry picked from commit 7737458) Signed-off-by: Michael Roth <[email protected]>
1 parent de98dc9 commit 05c5feb

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

net/l2tpv3.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ int net_init_l2tpv3(const NetClientOptions *opts,
660660
if (fd == -1) {
661661
fd = -errno;
662662
error_report("l2tpv3_open : socket creation failed, errno = %d", -fd);
663-
freeaddrinfo(result);
664663
goto outerr;
665664
}
666665
if (bind(fd, (struct sockaddr *) result->ai_addr, result->ai_addrlen)) {

0 commit comments

Comments
 (0)