projects
/
platform
/
upstream
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1373066
)
libcody: Avoid double-free
author
Jonathan Wakely
<jwakely@redhat.com>
Thu, 21 Oct 2021 13:17:43 +0000
(14:17 +0100)
committer
Jonathan Wakely
<jwakely@redhat.com>
Thu, 21 Oct 2021 21:23:00 +0000
(22:23 +0100)
If the listen call fails then 'goto fail' will jump to that label and
use freeaddrinfo again. Set the pointer to null to prevent that.
libcody/ChangeLog:
* netserver.cc (ListenInet6): Set pointer to null after
deallocation.
libcody/netserver.cc
patch
|
blob
|
history
diff --git
a/libcody/netserver.cc
b/libcody/netserver.cc
index
30202c5
..
0499b57
100644
(file)
--- a/
libcody/netserver.cc
+++ b/
libcody/netserver.cc
@@
-140,6
+140,7
@@
int ListenInet6 (char const **e, char const *name, int port, unsigned backlog)
listen:;
freeaddrinfo (addrs);
+ addrs = nullptr;
if (listen (fd, backlog ? backlog : 17) < 0)
{