]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/tools/slapcat.c
Fix cargv leak in recursive read_config()
[openldap] / servers / slapd / tools / slapcat.c
index 905bcbb605d2ce835f00e2fe4397996d85dce742..a4400d6297207eca1d7299d77465069e6198f90e 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 #include "portable.h"
@@ -22,10 +22,10 @@ main( int argc, char **argv )
 
        slap_tool_init( "slapcat", SLAPCAT, argc, argv );
 
-       if( !be->be_entry_open &&
-               !be->be_entry_close &&
-               !be->be_entry_first &&
-               !be->be_entry_next &&
+       if( !be->be_entry_open ||
+               !be->be_entry_close ||
+               !be->be_entry_first ||
+               !be->be_entry_next ||
                !be->be_entry_get )
        {
                fprintf( stderr, "%s: database doesn't support necessary operations.\n",
@@ -59,7 +59,7 @@ main( int argc, char **argv )
                }
 
                data = entry2str( e, &len );
-               entry_free( e );
+               be_entry_release_r( be, 0L, 0L, e );
 
                if ( data == NULL ) {
                        printf("# bad data for entry id=%08lx\n\n", (long) id );