summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}