]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/candidates.c
Do not return pointers into BerElement we do not own
[openldap] / servers / slapd / back-meta / candidates.c
index 1c2fb8d58f3931a95c49413094cb242a7a60692b..3aaab4d5fbfeac78075bbb1d61ef7f7fc531dcfd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2001 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  *
  * Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
@@ -214,7 +214,7 @@ meta_clear_unused_candidates(
                if ( i == candidate ) {
                        continue;
                }
-               meta_clear_one_candidate( lc->conns[ i ], reallyclean );
+               meta_clear_one_candidate( &lc->conns[ i ], reallyclean );
        }
 
        return 0;
@@ -242,9 +242,10 @@ meta_clear_one_candidate(
                lsc->ld = NULL;
        }
 
-       if ( lsc->bound_dn != NULL ) {
-               ber_bvfree( lsc->bound_dn );
-               lsc->bound_dn = NULL;
+       if ( lsc->bound_dn.bv_val != NULL ) {
+               ber_memfree( lsc->bound_dn.bv_val );
+               lsc->bound_dn.bv_val = NULL;
+               lsc->bound_dn.bv_len = 0;
        }
 
        return 0;