Skip to content
Snippets Groups Projects
Commit 2a24cbb5 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

don't leak text/matched

parent 3aca0119
No related branches found
No related tags found
No related merge requests found
......@@ -135,6 +135,12 @@ retry:
(char **)&rs->sr_matched,
(char **)&rs->sr_text,
NULL, NULL, 0 );
if ( rs->sr_matched && rs->sr_matched[ 0 ] == '\0' ) {
free( (char *)rs->sr_matched );
}
if ( rs->sr_text && rs->sr_text[ 0 ] == '\0' ) {
free( (char *)rs->sr_text );
}
if ( rc == LDAP_SUCCESS ) {
if ( rs->sr_err == LDAP_SUCCESS ) {
struct berval newpw;
......@@ -165,17 +171,19 @@ retry:
}
}
send_ldap_result( op, rs );
if ( rs->sr_matched ) {
free( (char *)rs->sr_matched );
}
if ( rs->sr_text ) {
free( (char *)rs->sr_text );
}
rs->sr_matched = NULL;
rs->sr_text = NULL;
rc = -1;
}
/* these have to be freed anyway... */
if ( rs->sr_matched ) {
free( (char *)rs->sr_matched );
}
if ( rs->sr_text ) {
free( (char *)rs->sr_text );
}
rs->sr_matched = NULL;
rs->sr_text = NULL;
if ( lc != NULL ) {
ldap_back_release_conn( op, rs, lc );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment