]> git.sur5r.net Git - openldap/commitdiff
Next try to fix the core dump problem on FreeBSD: eliminate ldbm_datum_free(),
authorKurt Spanier <ksp@openldap.org>
Wed, 7 Apr 1999 13:15:51 +0000 (13:15 +0000)
committerKurt Spanier <ksp@openldap.org>
Wed, 7 Apr 1999 13:15:51 +0000 (13:15 +0000)
because it's already done in ldbm_nextkey().

servers/slapd/tools/ldbmcat.c

index 0538001735d432e703471b39f64f7246dc5aa4be..bfdfffa98374bcf595bee28aaf3a528cd9b7d4e3 100644 (file)
@@ -19,7 +19,7 @@ usage( char *name )
 int
 main( int argc, char **argv )
 {
-        Datum                key, last, data;
+        Datum               key, data;
         LDBM                dbp;
         char                *file, *s;
         int                printid = 1;
@@ -29,7 +29,6 @@ main( int argc, char **argv )
 #endif
 
         ldbm_datum_init( key );
-        ldbm_datum_init( last );
         ldbm_datum_init( data );
 
         if ( argc < 2 || argc > 3 || ( argc == 3 && strcmp( argv[1], "-n" )
@@ -48,14 +47,12 @@ main( int argc, char **argv )
                 exit ( 1 );
         }
 
-        last.dptr = NULL;
-
 #ifdef HAVE_BERKELEY_DB2
         for ( key = ldbm_firstkey( dbp, &cursorp ); key.dptr != NULL;
-            key = ldbm_nextkey( dbp, last, cursorp ) )
+            key = ldbm_nextkey( dbp, key, cursorp ) )
 #else
         for ( key = ldbm_firstkey( dbp ); key.dptr != NULL;
-            key = ldbm_nextkey( dbp, last ) )
+            key = ldbm_nextkey( dbp, key ) )
 #endif
         {
                 data = ldbm_fetch( dbp, key );
@@ -76,12 +73,7 @@ main( int argc, char **argv )
                 } else {
 
                                }
-
-                ldbm_datum_free( dbp, last );
-                last = key;
-
         }
-        ldbm_datum_free( dbp, last );
         ldbm_close( dbp );
 
         exit( 0 );