Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct
[kai/samba.git] / source / utils / net_util.c
index 34355c90eb0e8050ca72e031a029e61e23eb1ae2..576c2191b31763f16972b83599f7bde68103dfde 100644 (file)
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 
 #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,
@@ -83,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);
        }
-       cli_rpc_pipe_close(lsa_pipe);
+       TALLOC_FREE(lsa_pipe);
 
        return result;
 }