mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
Fix - v2ref returned a pointer that it did not allocate, and send_ldap_result
would try to free it. Also, send_search_result was not freeing the pointer, but it should have been.
This commit is contained in:
parent
f0916150f3
commit
fe79f5d12a
1 changed files with 11 additions and 3 deletions
|
|
@ -23,8 +23,14 @@ static char *v2ref( struct berval **ref, const char *text )
|
|||
size_t len = 0, i = 0;
|
||||
char *v2;
|
||||
|
||||
if(ref == NULL) return (char *)text;
|
||||
|
||||
if(ref == NULL)
|
||||
{
|
||||
if (text)
|
||||
return ch_strdup(text);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (text) {
|
||||
len = strlen( text );
|
||||
if (text[len-1] != '\n')
|
||||
|
|
@ -428,7 +434,7 @@ send_ldap_result(
|
|||
(long) tag, (long) err, text ? text : "" );
|
||||
|
||||
if( tmp != NULL ) {
|
||||
free(tmp);
|
||||
ch_free(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -499,6 +505,8 @@ send_search_result(
|
|||
(long) op->o_connid, (long) op->o_opid,
|
||||
(long) tag, (long) err, text ? text : "" );
|
||||
|
||||
if (tmp != NULL)
|
||||
ch_free(tmp);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue