Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct
[kai/samba.git] / source / utils / net_util.c
index c08eae3337514ee7519f78af540ff06ff3bbc8dc..576c2191b31763f16972b83599f7bde68103dfde 100644 (file)
 #include "includes.h"
 #include "utils/net.h"
 
 #include "includes.h"
 #include "utils/net.h"
 
-bool is_valid_policy_hnd(const POLICY_HND *hnd)
-{
-       POLICY_HND tmp;
-       ZERO_STRUCT(tmp);
-       return (memcmp(&tmp, hnd, sizeof(tmp)) != 0);
-}
-
 NTSTATUS net_rpc_lookup_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
                             const char *name, const char **ret_domain,
                             const char **ret_name, DOM_SID *ret_sid,
 NTSTATUS net_rpc_lookup_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
                             const char *name, const char **ret_domain,
                             const char **ret_name, DOM_SID *ret_sid,
@@ -82,7 +75,7 @@ NTSTATUS net_rpc_lookup_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
        if (is_valid_policy_hnd(&pol)) {
                rpccli_lsa_Close(lsa_pipe, mem_ctx, &pol);
        }
        if (is_valid_policy_hnd(&pol)) {
                rpccli_lsa_Close(lsa_pipe, mem_ctx, &pol);
        }
-       cli_rpc_pipe_close(lsa_pipe);
+       TALLOC_FREE(lsa_pipe);
 
        return result;
 }
 
        return result;
 }