]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fixed malloc -> talloc problems pointed out by Simo.
authorJeremy Allison <jra@samba.org>
Fri, 24 Aug 2001 07:32:51 +0000 (07:32 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 24 Aug 2001 07:32:51 +0000 (07:32 +0000)
Jeremy

source/rpc_parse/parse_lsa.c
source/rpc_server/srv_lsa_nt.c

index d07c91e13732ed77b41f0425f1dd49c114f10856..2c588912fe6e7d858c719d4665b734ef42cb4597 100644 (file)
@@ -530,7 +530,7 @@ BOOL lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e,
  Inits an LSA_R_ENUM_TRUST_DOM structure.
 ********************************************************************/
 
-void init_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, uint32 enum_context, 
+void init_r_enum_trust_dom(TALLOC_CTX *ctx, LSA_R_ENUM_TRUST_DOM *r_e, uint32 enum_context, 
                           char *domain_name, DOM_SID *domain_sid,
                            uint32 status)
 {
@@ -545,14 +545,14 @@ void init_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, uint32 enum_context,
                 r_e->ptr_enum_domains = 1;
                 r_e->num_domains2 = 1;
                
-               if (!(r_e->hdr_domain_name = (UNIHDR2 *)
-                     malloc(sizeof(UNIHDR2)))) return;
+               if (!(r_e->hdr_domain_name = (UNIHDR2 *)talloc(ctx,sizeof(UNIHDR2))))
+                       return;
 
-               if (!(r_e->uni_domain_name = (UNISTR2 *)
-                     malloc(sizeof(UNISTR2)))) return;
+               if (!(r_e->uni_domain_name = (UNISTR2 *)talloc(ctx,sizeof(UNISTR2))))
+                       return;
 
-               if (!(r_e->domain_sid = (DOM_SID2 *)
-                     malloc(sizeof(DOM_SID2)))) return;
+               if (!(r_e->domain_sid = (DOM_SID2 *)talloc(ctx,sizeof(DOM_SID2))))
+                       return;
 
                init_uni_hdr2(&r_e->hdr_domain_name[0], len_domain_name);
                init_unistr2 (&r_e->uni_domain_name[0], domain_name, 
index a6e45ec03a624aa65e64258e0489f18652222e02..cb1b2fb3c98d5c0b43b39f3873cb85732eb902d3 100644 (file)
@@ -335,7 +335,7 @@ uint32 _lsa_enum_trust_dom(pipes_struct *p, LSA_Q_ENUM_TRUST_DOM *q_u, LSA_R_ENU
                return NT_STATUS_INVALID_HANDLE;
 
        /* set up the LSA QUERY INFO response */
-       init_r_enum_trust_dom(r_u, enum_context, dom_name, dom_sid,
+       init_r_enum_trust_dom(p->mem_ctx, r_u, enum_context, dom_name, dom_sid,
              dom_name != NULL ? NT_STATUS_NOPROBLEMO : NT_STATUS_UNABLE_TO_FREE_VM);
 
        return r_u->status;