From d09a32f5d795ad9ddf6ed5d67f2b1f2b4480dcf0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 14 Dec 2005 18:22:38 +0000 Subject: r12238: don't crash when an error happens while connecting and the packet_context isn't inplace yet metze (This used to be commit 064d9409c3dda25a803fd5ca9ad15c48271e8905) --- source4/libcli/wrepl/winsrepl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source4/libcli/wrepl') 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; } -- cgit