[Freeipa-devel] [PATCH 0088] Don't error when find_base() fails if a base is not required

Martin Basti mbasti at redhat.com
Mon Jan 11 16:45:10 UTC 2016



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
     }


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160111/325c5494/attachment.htm>


More information about the Freeipa-devel mailing list