summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-04-27 14:17:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:51:38 -0500
commit9c6c917571aaf4244213f68435eb8ac2470034b3 (patch)
tree302913c09b9b6e0e86ed510234c99556cf7c0dfd /source4/librpc/rpc
parent4d23d4b21029c7958055cf8fac1052ad16f67752 (diff)
downloadsamba-9c6c917571aaf4244213f68435eb8ac2470034b3.tar.gz
samba-9c6c917571aaf4244213f68435eb8ac2470034b3.tar.bz2
samba-9c6c917571aaf4244213f68435eb8ac2470034b3.zip
r22534: don't remove socket and fd_event before we told the
packet layer. also fix double free (left over from cut-n-paste) metze (This used to be commit a26db7e694def6206345222a240d160fac17dd7d)
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index e1ba2d769d..547b3ffb43 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -50,24 +50,22 @@ static void sock_dead(struct dcerpc_connection *p, NTSTATUS status)
if (!sock) return;
+ if (sock->packet) {
+ packet_recv_disable(sock->packet);
+ packet_set_fde(sock->packet, NULL);
+ packet_set_socket(sock->packet, NULL);
+ }
+
if (sock->fde) {
talloc_free(sock->fde);
sock->fde = NULL;
}
if (sock->sock) {
- talloc_free(sock->fde);
- sock->fde = NULL;
talloc_free(sock->sock);
sock->sock = NULL;
}
- if (sock->packet) {
- packet_recv_disable(sock->packet);
- packet_set_fde(sock->packet, NULL);
- packet_set_socket(sock->packet, NULL);
- }
-
if (NT_STATUS_EQUAL(NT_STATUS_UNSUCCESSFUL, status)) {
status = NT_STATUS_UNEXPECTED_NETWORK_ERROR;
}