s3-dcerpc: Fix potential memleak
authorSimo Sorce <idra@samba.org>
Sat, 17 Jul 2010 20:01:07 +0000 (16:01 -0400)
committerSimo Sorce <idra@samba.org>
Wed, 21 Jul 2010 23:13:27 +0000 (19:13 -0400)
Use a free function for schannel data too for now.

source3/rpc_server/srv_pipe.c

index b25f122e56e6828e3a42502593bf6212dc649cf7..508cb3f36aa32e883bfa0b512b1cbfeea892e739 100644 (file)
@@ -89,6 +89,11 @@ static void free_pipe_ntlmssp_auth_data(struct pipe_auth_data *auth)
        TALLOC_FREE(auth->a_u.auth_ntlmssp_state);
 }
 
+static void free_pipe_schannel_auth_data(struct pipe_auth_data *auth)
+{
+       TALLOC_FREE(auth->a_u.schannel_auth);
+}
+
 static DATA_BLOB generic_session_key(void)
 {
        return data_blob("SystemLibraryDTC", 16);
@@ -1100,7 +1105,7 @@ static bool pipe_schannel_auth_bind(pipes_struct *p,
                neg.oem_netbios_domain.a, neg.oem_netbios_computer.a));
 
        /* We're finished with this bind - no more packets. */
-       p->auth.auth_data_free_func = NULL;
+       p->auth.auth_data_free_func = &free_pipe_schannel_auth_data;
        p->auth.auth_type = PIPE_AUTH_TYPE_SCHANNEL;
 
        p->pipe_bound = True;