summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-01-07 18:11:24 +0100
committerVolker Lendecke <vl@samba.org>2009-01-08 22:29:54 +0100
commit825500f5dafb848b95f5a5ea6595cc24f377bc3a (patch)
treee2241f63459c1a58639ef64f665bc4941be39bbb /source3/rpc_server
parente94d7f53f9339b73ee5b20f5061b9b74f9866cee (diff)
downloadsamba-825500f5dafb848b95f5a5ea6595cc24f377bc3a.tar.gz
samba-825500f5dafb848b95f5a5ea6595cc24f377bc3a.tar.bz2
samba-825500f5dafb848b95f5a5ea6595cc24f377bc3a.zip
Use TALLOC for struct lsa_info
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_lsa_nt.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 3063427595..0db739dff2 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -102,9 +102,7 @@ static int init_lsa_ref_domain_list(TALLOC_CTX *mem_ctx,
static void free_lsa_info(void *ptr)
{
- struct lsa_info *lsa = (struct lsa_info *)ptr;
-
- SAFE_FREE(lsa);
+ TALLOC_FREE(ptr);
}
/***************************************************************************
@@ -400,10 +398,11 @@ NTSTATUS _lsa_OpenPolicy2(pipes_struct *p,
acc_granted = LSA_POLICY_ALL_ACCESS;
/* associate the domain SID with the (unique) handle. */
- if ((info = SMB_MALLOC_P(struct lsa_info)) == NULL)
+ info = TALLOC_ZERO_P(NULL, struct lsa_info);
+ if (info == NULL) {
return NT_STATUS_NO_MEMORY;
+ }
- ZERO_STRUCTP(info);
sid_copy(&info->sid,get_global_sam_sid());
info->access = acc_granted;
@@ -448,10 +447,11 @@ NTSTATUS _lsa_OpenPolicy(pipes_struct *p,
}
/* associate the domain SID with the (unique) handle. */
- if ((info = SMB_MALLOC_P(struct lsa_info)) == NULL)
+ info = TALLOC_ZERO_P(NULL, struct lsa_info);
+ if (info == NULL) {
return NT_STATUS_NO_MEMORY;
+ }
- ZERO_STRUCTP(info);
sid_copy(&info->sid,get_global_sam_sid());
info->access = acc_granted;
@@ -1555,10 +1555,11 @@ NTSTATUS _lsa_CreateAccount(pipes_struct *p,
/* associate the user/group SID with the (unique) handle. */
- if ((info = SMB_MALLOC_P(struct lsa_info)) == NULL)
+ info = TALLOC_ZERO_P(NULL, struct lsa_info);
+ if (info == NULL) {
return NT_STATUS_NO_MEMORY;
+ }
- ZERO_STRUCTP(info);
info->sid = *r->in.sid;
info->access = r->in.access_mask;
@@ -1599,10 +1600,11 @@ NTSTATUS _lsa_OpenAccount(pipes_struct *p,
return NT_STATUS_ACCESS_DENIED;
#endif
/* associate the user/group SID with the (unique) handle. */
- if ((info = SMB_MALLOC_P(struct lsa_info)) == NULL)
+ info = TALLOC_ZERO_P(NULL, struct lsa_info);
+ if (info == NULL) {
return NT_STATUS_NO_MEMORY;
+ }
- ZERO_STRUCTP(info);
info->sid = *r->in.sid;
info->access = r->in.access_mask;