r5980: Fix double free after unexpected disconnect.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 22 Mar 2005 23:20:41 +0000 (23:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:11:12 +0000 (13:11 -0500)
(This used to be commit 6149bd3702a0293fc1f798de7c399e3e6858416d)

source4/librpc/rpc/dcerpc_sock.c

index 6222fd6bc96470e06f4b7941662cc78f80a3f859..a7ceb3875094087865b9f2c8fbc667221458f15a 100644 (file)
@@ -275,7 +275,11 @@ static struct event_context *sock_event_context(struct dcerpc_connection *p)
 */
 static NTSTATUS sock_shutdown_pipe(struct dcerpc_connection *p)
 {
-       sock_dead(p, NT_STATUS_OK);
+       struct sock_private *sock = p->transport.private;
+
+       if (sock && sock->sock) {
+               sock_dead(p, NT_STATUS_OK);
+       }
 
        return NT_STATUS_OK;
 }