Squid LDAP auth module memory leak patch

From: Sean Burford <sean.burford@dont-contact.us>
Date: Mon, 16 Jul 2001 17:25:49 +0930

Hi,

The LDAP authentication module distributed with Squid up to at least
version 2.4 leaks memory. The attached patch fixes this problem.

I have also attached the script that I used to test this module for
memory leaks under Linux.

-- 
Sean

*** squid-2.4.STABLE1/auth_modules/LDAP/squid_ldap_auth.c.orig Mon Jul 16 17:15:18 2001
--- squid-2.4.STABLE1/auth_modules/LDAP/squid_ldap_auth.c Mon Jul 16 17:18:12 2001
***************
*** 68,84 ****
        if ((user = strtok(buf, " ")) == NULL)
          {
            printf("ERR\n");
            continue;
          }
        if ((passwd = strtok(NULL, "")) == NULL)
          {
            printf("ERR\n");
            continue;
          }
        if(checkLDAP(ld, user, passwd) != 0)
          {
            printf("ERR\n");
- continue;
          }
        else
          {
--- 68,85 ----
        if ((user = strtok(buf, " ")) == NULL)
          {
            printf("ERR\n");
+ ldap_unbind(ld);
            continue;
          }
        if ((passwd = strtok(NULL, "")) == NULL)
          {
            printf("ERR\n");
+ ldap_unbind(ld);
            continue;
          }
        if(checkLDAP(ld, user, passwd) != 0)
          {
            printf("ERR\n");
          }
        else
          {

Received on Mon Jul 16 2001 - 03:15:27 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:07 MST