test for DB_RECNO type before freeing key.data
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 30 Apr 1993 01:52:01 +0000 (17:52 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 30 Apr 1993 01:52:01 +0000 (17:52 -0800)
SCCS-vsn: lib/libc/db/test/dbtest.c 5.13

usr/src/lib/libc/db/test/dbtest.c

index 792ce94..cef7e0c 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)dbtest.c   5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)dbtest.c   5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -184,7 +184,8 @@ ldata:                      switch(command) {
                                err("line %lu: command doesn't take data",
                                    lineno);
                        }
                                err("line %lu: command doesn't take data",
                                    lineno);
                        }
-                       free(key.data);
+                       if (type != DB_RECNO)
+                               free(key.data);
                        free(data.data);
                        state = COMMAND;
                        break;
                        free(data.data);
                        state = COMMAND;
                        break;