summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@redhat.com>2016-10-25 22:33:10 +0530
committerMichael Adam <obnox@samba.org>2016-10-25 23:20:51 +0200
commit63d83be5925bcefc64275be5ccb2312596bf5ce8 (patch)
treed71f18094f000ebc4bc557b5aed5958e0c6ef9b5
parent85c2d663ec4dc7dc0170df676721e9a63f18fe40 (diff)
downloadsocket_wrapper-63d83be5925bcefc64275be5ccb2312596bf5ce8.tar.gz
socket_wrapper-63d83be5925bcefc64275be5ccb2312596bf5ce8.tar.xz
socket_wrapper-63d83be5925bcefc64275be5ccb2312596bf5ce8.zip
swrap: Fix use-after-free
This was introduced by commit 9ce583b6cd6f55d473e5b54794fb06450997ebc8 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r--src/socket_wrapper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index d40f8b6..ece5a10 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -1733,7 +1733,7 @@ static void swrap_remove_stale(int fd)
SWRAP_DLIST_REMOVE(socket_fds, fi);
free(fi);
- si = &sockets[fi->si_index];
+ si = &sockets[si_index];
si->refcount--;
if (si->refcount > 0) {