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

Jakub Hrozek jhrozek at redhat.com
Tue Jan 15 19:54:32 UTC 2013


On Tue, Jan 15, 2013 at 02:12:48PM -0500, Simo Sorce wrote:
> 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.

Pushed to master and sssd-1-9



More information about the sssd-devel mailing list