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

(ITS#4052) memory leak in unbind.c



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


The ldap controls structure should be freed as well...


--- openldap-2.2.26/libraries/libldap/unbind.c.orig	Thu Sep 29 16:14:49 2005
+++ openldap-2.2.26/libraries/libldap/unbind.c	Thu Sep 29 16:07:06 2005
@@ -154,6 +154,11 @@
 		ld->ld_options.ldo_tm_net = NULL;
 	}
 
+    if ( ld->ld_options.ldo_sctrls != NULL ) {
+        ldap_controls_free(ld->ld_options.ldo_sctrls);
+        ld->ld_options.ldo_sctrls = NULL;
+    }
+
 #ifdef HAVE_CYRUS_SASL
 	if ( ld->ld_options.ldo_def_sasl_mech != NULL ) {
 		LDAP_FREE( ld->ld_options.ldo_def_sasl_mech );