]> git.sur5r.net Git - openldap/commitdiff
Set res parameter to NULL upon ldap_search_ext_s entry. Likewise for friends.
authorQuanah Gibson-Mount <quanah@openldap.org>
Wed, 14 Apr 2010 20:08:22 +0000 (20:08 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 14 Apr 2010 20:08:22 +0000 (20:08 +0000)
Note in manual that res parameter should be freed regardless of return value
of ldap_search_ext_s (or friends).

doc/man/man3/ldap_search.3
libraries/libldap/search.c

index 519a4dd1ee96d906380dac40b09feb24e0b7cea9..12afe646bccb3409dd3fd90a0d7de62d369d954b 100644 (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()
index 6554b2eff129b6b763bb16c9551ab5d14e9d2f9f..d74a6109a307a314a982a39887c00775851b37bd 100644 (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 );