Set res parameter to NULL upon ldap_search_ext_s entry. Likewise for friends.

Note in manual that res parameter should be freed regardless of return value
of ldap_search_ext_s (or friends).
This commit is contained in:
Kurt Zeilenga 2010-01-29 23:11:24 +00:00
parent 797387c4ef
commit f967ec3b4e
2 changed files with 14 additions and 0 deletions

View file

@ -114,6 +114,14 @@ emulate read) or LDAP_SCOPE_ONELEVEL (to emulate list).
These routines may dynamically allocate memory. The caller is
responsible for freeing such memory using supplied deallocation
routines. Return values are contained in <ldap.h>.
.LP
Note that \fIres\fR parameter of
.B ldap_search_ext_s()
and
.B ldap_search_s()
should be freed with
.B ldap_msgfree()
regardless of return value of these functions.
.SH DEPRECATED INTERFACES
The
.B ldap_search()

View file

@ -169,6 +169,8 @@ ldap_pvt_search_s(
int rc;
int msgid;
*res = NULL;
rc = ldap_pvt_search( ld, base, scope, filter, attrs, attrsonly,
sctrls, cctrls, timeout, sizelimit, deref, &msgid );
@ -393,6 +395,8 @@ ldap_search_st(
{
int msgid;
*res = NULL;
if ( (msgid = ldap_search( ld, base, scope, filter, attrs, attrsonly ))
== -1 )
return( ld->ld_errno );
@ -421,6 +425,8 @@ ldap_search_s(
{
int msgid;
*res = NULL;
if ( (msgid = ldap_search( ld, base, scope, filter, attrs, attrsonly ))
== -1 )
return( ld->ld_errno );