mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Plug memory leaks - free() controls in LDAP*
This commit is contained in:
parent
5c5a834db8
commit
f9e505727e
@ -388,7 +388,8 @@ ldap_set_option(
|
||||
LDAPControl *const *controls =
|
||||
(LDAPControl *const *) invalue;
|
||||
|
||||
ldap_controls_free( lo->ldo_sctrls );
|
||||
if( lo->ldo_sctrls )
|
||||
ldap_controls_free( lo->ldo_sctrls );
|
||||
|
||||
if( controls == NULL || *controls == NULL ) {
|
||||
lo->ldo_sctrls = NULL;
|
||||
@ -407,7 +408,8 @@ ldap_set_option(
|
||||
LDAPControl *const *controls =
|
||||
(LDAPControl *const *) invalue;
|
||||
|
||||
ldap_controls_free( lo->ldo_cctrls );
|
||||
if( lo->ldo_cctrls )
|
||||
ldap_controls_free( lo->ldo_cctrls );
|
||||
|
||||
if( controls == NULL || *controls == NULL ) {
|
||||
lo->ldo_cctrls = NULL;
|
||||
|
@ -172,6 +172,16 @@ ldap_ld_free(
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( ld->ld_options.ldo_sctrls != NULL ) {
|
||||
ldap_controls_free( ld->ld_options.ldo_sctrls );
|
||||
ld->ld_options.ldo_sctrls = NULL;
|
||||
}
|
||||
|
||||
if ( ld->ld_options.ldo_cctrls != NULL ) {
|
||||
ldap_controls_free( ld->ld_options.ldo_cctrls );
|
||||
ld->ld_options.ldo_cctrls = NULL;
|
||||
}
|
||||
|
||||
ber_sockbuf_free( ld->ld_sb );
|
||||
|
||||
#ifdef LDAP_R_COMPILE
|
||||
|
Loading…
Reference in New Issue
Block a user