Author: abartlet
Date: 2004-11-05 06:56:39 +0000 (Fri, 05 Nov 2004)
New Revision: 3542

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3542

Log:
Re-indent, and fix a use-after-free by doing the talloc_destroy just a
little later.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c  2004-11-05 04:26:48 UTC (rev 
3541)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c  2004-11-05 06:56:39 UTC (rev 
3542)
@@ -810,10 +810,8 @@
                smbcli_tdis(cli);
                smbcli_shutdown(cli);
                talloc_destroy(mem_ctx);
-        return status;
-    }  
-
-       talloc_destroy(mem_ctx);
+               return status;
+       }
        
        /* this ensures that the reference count is decremented so
           a pipe close will really close the link */
@@ -824,6 +822,8 @@
        /* remember the binding string for possible secondary connections */
        (*p)->binding_string = dcerpc_binding_string((*p), binding);
 
+       talloc_destroy(mem_ctx);
+
        if (username && username[0] && (binding->flags & DCERPC_SCHANNEL_ANY)) {
                status = dcerpc_bind_auth_schannel(*p, pipe_uuid, pipe_version, 
                                                   domain, username, password);

Reply via email to