r4332: Fix a potential memleak.
[samba.git] / source4 / rpc_server / samr / dcesrv_samr.c
index 710d7830ef5688ee88be9bf8d0621ebb4fe88530..239dd58b60bfae4e121736b288b6916c50c828bc 100644 (file)
@@ -506,9 +506,9 @@ static NTSTATUS samr_CreateDomainGroup(struct dcesrv_call_state *dce_call, TALLO
        a_state->sam_ctx = d_state->sam_ctx;
        a_state->access_mask = r->in.access_mask;
        a_state->domain_state = talloc_reference(a_state, d_state);
        a_state->sam_ctx = d_state->sam_ctx;
        a_state->access_mask = r->in.access_mask;
        a_state->domain_state = talloc_reference(a_state, d_state);
-       a_state->account_dn = talloc_steal(d_state, msg.dn);
-       a_state->account_sid = talloc_strdup(d_state, sidstr);
-       a_state->account_name = talloc_strdup(d_state, groupname);
+       a_state->account_dn = talloc_steal(a_state, msg.dn);
+       a_state->account_sid = talloc_strdup(a_state, sidstr);
+       a_state->account_name = talloc_strdup(a_state, groupname);
        if (!a_state->account_name || !a_state->account_sid) {
                talloc_free(a_state);
                return NT_STATUS_NO_MEMORY;
        if (!a_state->account_name || !a_state->account_sid) {
                talloc_free(a_state);
                return NT_STATUS_NO_MEMORY;