Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct
[kai/samba.git] / source / utils / smbcacls.c
index 134f5617603ffc44f35ac81af6c24ad08e9c69d7..af14c622dc9616e685945eded431f88b97c84a58 100644 (file)
@@ -103,9 +103,7 @@ static NTSTATUS cli_lsa_lookup_sid(struct cli_state *cli,
 
        status = NT_STATUS_OK;
  fail:
-       if (p != NULL) {
-               cli_rpc_pipe_close(p);
-       }
+       TALLOC_FREE(p);
        cli_tdis(cli);
        cli->cnum = orig_cnum;
        TALLOC_FREE(frame);
@@ -151,9 +149,7 @@ static NTSTATUS cli_lsa_lookup_name(struct cli_state *cli,
 
        status = NT_STATUS_OK;
  fail:
-       if (p != NULL) {
-               cli_rpc_pipe_close(p);
-       }
+       TALLOC_FREE(p);
        cli_tdis(cli);
        cli->cnum = orig_cnum;
        TALLOC_FREE(frame);