On Mon, 2016-01-11 at 17:45 +0100, Martin Basti wrote: > > > On 14.12.2015 16:22, Nathaniel McCallum wrote: > > We always have to call find_base() in order to force libldap to > > open > > the socket. However, if no base is actually required then there is > > no reason to error out if find_base() fails. This condition can > > arise > > when anonymous binds are disabled. > > > > > Hello, > > IMO this code may result into free(NULL); > > /* Always find the base since this forces open the socket. */ > basetmp = find_base(ldp); > if (base != NULL) { > if (basetmp == NULL) > return ENOTCONN; > *base = basetmp; > } else { > free(basetmp); <-- here, if both base and basetmp are NULL > }
>From the man page for free(): "If ptr is NULL, no operation is performed." Nathaniel -- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code