From 1e34c2959628b3134943d8b361230b5bc2a37d5e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 11 Mar 2006 02:48:20 +0000 Subject: r14196: Move to using talloc, not malloc for all policy handles. Jeremy (This used to be commit 6f4804a265f60c614e6e215ed663da0d8205c613) --- source3/libmsrpc/cac_lsarpc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/libmsrpc/cac_lsarpc.c b/source3/libmsrpc/cac_lsarpc.c index 1877e9cd7e..13aaa01754 100644 --- a/source3/libmsrpc/cac_lsarpc.c +++ b/source3/libmsrpc/cac_lsarpc.c @@ -65,7 +65,7 @@ int cac_LsaOpenPolicy(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaOpenP return CAC_FAILURE; } - policy = SMB_MALLOC_P(POLICY_HND); + policy = TALLOC_P(mem_ctx, POLICY_HND); if(!policy) { errno = ENOMEM; hnd->status = NT_STATUS_NO_MEMORY; @@ -95,7 +95,6 @@ int cac_LsaOpenPolicy(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaOpenP } if(!NT_STATUS_IS_OK(hnd->status)) { - SAFE_FREE(policy); return CAC_FAILURE; } @@ -125,14 +124,13 @@ int cac_LsaClosePolicy(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *po return CAC_FAILURE; } - hnd->status = rpccli_lsa_close(pipe_hnd, mem_ctx, pol); + TALLOC_FREE(pol); + if(!NT_STATUS_IS_OK(hnd->status)) return CAC_FAILURE; - SAFE_FREE(pol); - return CAC_SUCCESS; } -- cgit