summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-12-14 18:22:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:23 -0500
commitd09a32f5d795ad9ddf6ed5d67f2b1f2b4480dcf0 (patch)
tree03d5f0864fc75431ad3d24606acc4f766d146211
parentdaa4cce71dddd93bd619a8569d7af3aef552bfea (diff)
downloadsamba-d09a32f5d795ad9ddf6ed5d67f2b1f2b4480dcf0.tar.gz
samba-d09a32f5d795ad9ddf6ed5d67f2b1f2b4480dcf0.tar.bz2
samba-d09a32f5d795ad9ddf6ed5d67f2b1f2b4480dcf0.zip
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)
-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;
}