summaryrefslogtreecommitdiff
path: root/lib/tsocket
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-09-27 23:57:34 +0200
committerStefan Metzmacher <metze@samba.org>2010-09-28 01:02:55 +0000
commit38f505530ba06323a56c7d3914630efffcd12629 (patch)
treed1a46746c0cc689490bea756594bf4fa00984c4c /lib/tsocket
parentf98d217514433cd06887f8c0217a7835392f0375 (diff)
downloadsamba-38f505530ba06323a56c7d3914630efffcd12629.tar.gz
samba-38f505530ba06323a56c7d3914630efffcd12629.tar.bz2
samba-38f505530ba06323a56c7d3914630efffcd12629.zip
tsocket: make sure we delete the fd event before calling close()
We got random double free errors, when getting events from epoll_wait() and try to dereference the private talloc pointer attached to it. Before doing the close() in the tstream_disconnect_send() function we need to delete the fd event. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Sep 28 01:02:55 UTC 2010 on sn-devel-104
Diffstat (limited to 'lib/tsocket')
-rw-r--r--lib/tsocket/tsocket_bsd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c
index dabf962e87..6fb1535ea0 100644
--- a/lib/tsocket/tsocket_bsd.c
+++ b/lib/tsocket/tsocket_bsd.c
@@ -1107,6 +1107,7 @@ static struct tevent_req *tdgram_bsd_disconnect_send(TALLOC_CTX *mem_ctx,
goto post;
}
+ TALLOC_FREE(bsds->fde);
ret = close(bsds->fd);
bsds->fd = -1;
err = tsocket_bsd_error_from_errno(ret, errno, &dummy);