[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4048) cryus.c memory leak



Full_Name: Mike Patnode
Version: 2.2.26
OS: RedHat
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (63.199.144.29)


ldap_int_sasl_bind() assumes that if bv_len == 0, then there's no need to free
the berval.  You may of still allocated a berval struct, even if you didn't put
any data into it.

Note, ber_bvfree() can handle a null pointer.

--- openldap-2.2.26/libraries/libldap/cyrus.c.orig	Wed Sep 28 13:09:37 2005
+++ openldap-2.2.26/libraries/libldap/cyrus.c	Tue Sep 27 21:00:27 2005
@@ -652,6 +652,8 @@
 #endif
                 ber_bvfree( scred );
             }
+            else
+                ber_bvfree( scred );
             rc = ld->ld_errno;
             goto done;
         }
@@ -675,6 +677,8 @@
                 rc = ld->ld_errno = LDAP_LOCAL_ERROR;
                 goto done;
             }
+            else
+                ber_bvfree( scred );
             break;
         }