Commit 7502c755 authored by HAMANO Tsukasa's avatar HAMANO Tsukasa
Browse files

ITS#9860 fix ldapsearch memory leaks

The following free() is not necessary due to these reference has been copied to c[i].ldctl_value.bv_val

```
if ( seber ) ber_free( seber, 1 );
if ( vrber ) ber_free( vrber, 1 );
```
parent 8bc0f750
Pipeline #4401 failed with stage
in 36 minutes and 24 seconds
......@@ -1439,9 +1439,11 @@ getNextPage:
tool_server_controls( ld, c, i );
if ( seber ) ber_free( seber, 1 );
if ( vrber ) ber_free( vrber, 1 );
/* When step back nctrls, we lose opportunity to free the
* added control value. They should be free here. */
for ( ; nctrls-- > save_nctrls; ) {
ber_memfree( c[ nctrls ].ldctl_value.bv_val );
}
/* step back to the original number of controls, so that
* those set while parsing args are preserved */
nctrls = save_nctrls;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment