summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libcli/wrepl/winsrepl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c
index 109910be1f..f8e51d925f 100644
--- a/source4/libcli/wrepl/winsrepl.c
+++ b/source4/libcli/wrepl/winsrepl.c
@@ -38,15 +38,18 @@ static void wrepl_socket_dead(struct wrepl_socket *wrepl_socket, NTSTATUS status
talloc_set_destructor(wrepl_socket, NULL);
wrepl_socket->dead = True;
- if (wrepl_socket->event.fde) {
+ if (wrepl_socket->packet) {
packet_recv_disable(wrepl_socket->packet);
packet_set_fde(wrepl_socket->packet, NULL);
+ packet_set_socket(wrepl_socket->packet, NULL);
+ }
+
+ if (wrepl_socket->event.fde) {
talloc_free(wrepl_socket->event.fde);
wrepl_socket->event.fde = NULL;
}
if (wrepl_socket->sock) {
- packet_set_socket(wrepl_socket->packet, NULL);
talloc_free(wrepl_socket->sock);
wrepl_socket->sock = NULL;
}