[SSSD] [PATCH] LDAP: avoid complex realloc logic in save_rfc2307bis_group_memberships

Simo Sorce simo at redhat.com
Tue Jan 15 19:12:48 UTC 2013


On Tue, 2013-01-15 at 17:38 +0100, Jakub Hrozek wrote:
> The function tried to be smart and realloc only when needed, but that
> only lead to hard-to find bugs where the logic would not allocate the
> proper space. Remove the reallocation and prefer readability over
> speed
> in this case.
> 
> In particular, if one iteration hit the "if (num_added == 0) add=NULL"
> condition but the next group being processed had no members and set
> grp_count=0, then we'd use the add pointer from last iteration that
> was
> still NULL.

ACK

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York




More information about the sssd-devel mailing list