[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1567-g3fa6943

Derrell Lipman derrell.lipman at unwireduniverse.com
Tue May 12 16:08:47 GMT 2009


On Tue, May 12, 2009 at 12:02 PM, Volker Lendecke <vlendec at samba.org> wrote:

> - Log -----------------------------------------------------------------
> commit 3fa69438b9fafc13d522720e188e82455856fc1d
> Author: Volker Lendecke <vl at samba.org>
> Date:   Tue May 12 17:47:22 2009 +0200
>
>    Convert response.extra_data.data from malloc to talloc
>        /* Must copy domain into response first for debugging in parent */
> @@ -519,8 +517,8 @@ enum winbindd_result winbindd_dual_list_users(struct
> winbindd_domain *domain,
>        /* Allocate some memory for extra data.  Note that we limit
>           account names to sizeof(fstring) = 256 characters.
>           +1 for the ',' between group names */
> -       extra_data = (char *)SMB_REALLOC(extra_data,
> -               (sizeof(fstring) + 1) * num_entries);
> +       extra_data = talloc_array(state->mem_ctx, char,
> +                                 (sizeof(fstring) + 1) * num_entries);
>
> It looks like previously, extra_data could already contain some data which
was then realloc'ed to add more space, whereas now you always overwrite
extra_data each time. Is that correct? Is this potentially losing previously
initialized data that needs to stick around?

Derrell


More information about the samba-cvs mailing list