]> git.sur5r.net Git - openldap/commitdiff
ITS#6568 plug cldap memleaks
authorHoward Chu <hyc@openldap.org>
Wed, 2 Jun 2010 03:10:39 +0000 (03:10 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 2 Jun 2010 03:10:39 +0000 (03:10 +0000)
libraries/libldap/request.c
libraries/libldap/unbind.c

index 2c1e787bdf3721b822e7e8cfd122802b34705611..205599300a3fe8747f0a2b4029f29f4374e23a9e 100644 (file)
@@ -124,10 +124,14 @@ ldap_send_initial_request(
                        if (ld->ld_options.ldo_cldapdn)
                                ldap_memfree(ld->ld_options.ldo_cldapdn);
                        ld->ld_options.ldo_cldapdn = ldap_strdup(dn);
+                       ber_free( ber, 1 );
                        return 0;
                }
                if (msgtype != LDAP_REQ_ABANDON && msgtype != LDAP_REQ_SEARCH)
+               {
+                       ber_free( ber, 1 );
                        return LDAP_PARAM_ERROR;
+               }
        }
 #endif
 #ifdef LDAP_R_COMPILE
index 15e6ee4f1b23c62756e542f4f42ba4af7ac7b26d..bd4df7a8497fb6674592b28e82f7aef1784396c2 100644 (file)
@@ -154,6 +154,11 @@ ldap_ld_free(
                LDAP_FREE( ld->ld_options.ldo_peer );
                ld->ld_options.ldo_peer = NULL;
        }
+
+       if ( ld->ld_options.ldo_cldapdn != NULL ) {
+               LDAP_FREE( ld->ld_options.ldo_cldapdn );
+               ld->ld_options.ldo_cldapdn = NULL;
+       }
 #endif
 
 #ifdef HAVE_CYRUS_SASL