]> git.sur5r.net Git - openldap/commitdiff
ITS#2736 clear result strings
authorHoward Chu <hyc@openldap.org>
Sat, 27 Sep 2003 07:36:20 +0000 (07:36 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 27 Sep 2003 07:36:20 +0000 (07:36 +0000)
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/bind.c
servers/slapd/back-ldbm/compare.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c
servers/slapd/back-ldbm/referral.c
servers/slapd/back-ldbm/search.c

index 7406a93d7e8bcfd5abb8a7230f24d343c765c859..e4a5130b774fccbfa6ea99cdb6b4e1cacf89e932 100644 (file)
@@ -134,7 +134,8 @@ ldbm_back_add(
 
                        ber_bvarray_free( rs->sr_ref );
                        free( (char *)rs->sr_matched );
-
+                       rs->sr_ref = NULL;
+                       rs->sr_matched = NULL;
                        return rs->sr_err;
                }
 
@@ -220,6 +221,8 @@ ldbm_back_add(
 
                        ber_bvarray_free( rs->sr_ref );
                        free( (char *)rs->sr_matched );
+                       rs->sr_ref = NULL;
+                       rs->sr_matched = NULL;
                        return rs->sr_err;
                }
 
@@ -408,6 +411,7 @@ ldbm_back_add(
        }
 
        rs->sr_err = LDAP_SUCCESS;
+       rs->sr_text = NULL;
        send_ldap_result( op, rs );
 
        /* marks the entry as committed, so it is added to the cache;
index 73ab8217d1874b788942a36550c105550eb59b3f..e84935af0ec5ec862a4916005852377a9e7ea399 100644 (file)
@@ -81,6 +81,8 @@ ldbm_back_bind(
 
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
                if ( rs->sr_matched ) free( (char *)rs->sr_matched );
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                return rs->sr_err;
        }
 
@@ -145,7 +147,8 @@ ldbm_back_bind(
                send_ldap_result( op, rs );
 
                ber_bvarray_free( rs->sr_ref );
-
+               rs->sr_matched = NULL;
+               rs->sr_ref = NULL;
                rc = rs->sr_err;
                goto return_results;
        }
index 0f560e59d1f3cc06bdcd9849a46587ee1a99605b..0c41f24477997a4c9a0c9804c1869c6e9d4f2655 100644 (file)
@@ -50,7 +50,8 @@ ldbm_back_compare(
 
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
                free( (char *)rs->sr_matched );
-
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                return( 1 );
        }
 
@@ -72,7 +73,8 @@ ldbm_back_compare(
                send_ldap_result( op, rs );
 
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
-
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                rs->sr_err = 1;
                goto return_results;
        }
index 73ce46668331250d936225a972ebdf7e5cbcacc4..edcfbf5be47a1486b21579261cf6da65884f02f5 100644 (file)
@@ -72,7 +72,8 @@ ldbm_back_delete(
 
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
                free( (char *)rs->sr_matched );
-
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                return( -1 );
        }
 
@@ -115,7 +116,8 @@ ldbm_back_delete(
                send_ldap_result( op, rs );
 
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
-
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                rc = LDAP_REFERRAL;
                goto return_results;
        }
index 1e78935a79e4d5d7c3e58a4bc03d67c7520a2c58..290f29c02f0254d0ddee91b1fdff7ee20c8162fa 100644 (file)
@@ -335,6 +335,8 @@ ldbm_back_modify(
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
                free( (char *)rs->sr_matched );
 
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                return rs->sr_err;
        }
 
@@ -357,7 +359,8 @@ ldbm_back_modify(
                send_ldap_result( op, rs );
 
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
-
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                goto error_return;
        }
        
@@ -381,6 +384,7 @@ ldbm_back_modify(
                goto error_return;
        }
 
+       rs->sr_text = NULL;
        send_ldap_error( op, rs, LDAP_SUCCESS,
                NULL );
 
@@ -392,5 +396,6 @@ ldbm_back_modify(
 error_return:;
        cache_return_entry_w( &li->li_cache, e );
        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
+       rs->sr_text = NULL;
        return rs->sr_err;
 }
index 6897e34866ff7264f7b3e5e52592b10f60ad19b0..4a415061510db35d1713cb272801ad11f557835d 100644 (file)
@@ -104,7 +104,8 @@ ldbm_back_modrdn(
 
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
                free( (char *)rs->sr_matched );
-
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                return rs->sr_err;
        }
 
@@ -146,6 +147,8 @@ ldbm_back_modrdn(
                send_ldap_result( op, rs );
 
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                goto return_results;
        }
 
@@ -633,6 +636,7 @@ ldbm_back_modrdn(
        }
 
        rs->sr_err = LDAP_SUCCESS;
+       rs->sr_text = NULL;
        send_ldap_result( op, rs );
        rc = 0;
        cache_entry_commit( e );
@@ -677,5 +681,6 @@ return_results:
                entry_free( e );
        }
        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
+       rs->sr_text = NULL;
        return( rc );
 }
index 6aedb91e5f294a2ebd11b881e98dd0ce50c28b0d..fc14eb993c51bb9aa223866cdc3ed62ecc8d3aa9 100644 (file)
@@ -79,6 +79,8 @@ ldbm_back_referrals(
                }
 
                if ( rs->sr_matched ) free( (char *)rs->sr_matched );
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                return rs->sr_err;
        }
 
@@ -111,6 +113,8 @@ ldbm_back_referrals(
                }
 
                if( refs != NULL ) ber_bvarray_free( refs );
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
        }
 
        cache_return_entry_r( &li->li_cache, e );
index 4a463522085c54b6f25ace591d31aa018a643f4d..8d3949cc67a3760c5ffd2bc61c642c3f7ee999a9 100644 (file)
@@ -111,6 +111,8 @@ ldbm_back_search(
 
                ber_bvarray_free( rs->sr_ref );
                ber_memfree( matched_dn.bv_val );
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                return LDAP_REFERRAL;
        }
 
@@ -155,6 +157,8 @@ ldbm_back_search(
                }
 
                ber_memfree( matched_dn.bv_val );
+               rs->sr_ref = NULL;
+               rs->sr_matched = NULL;
                return LDAP_OTHER;
        }