diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 95dba93902..e80b681045 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -898,6 +898,13 @@ nextresp2: if ( lr != &dummy_lr ) { ldap_return_request( ld, lr, 1 ); + } else { + if ( lr->lr_res_matched ) { + LDAP_FREE( lr->lr_res_matched ); + } + if ( lr->lr_res_error ) { + LDAP_FREE( lr->lr_res_error ); + } } lr = NULL; }