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:
Howard Chu 1999-11-05 22:50:58 +00:00
parent f0916150f3
commit fe79f5d12a

View file

@ -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);
}