test for DB_RECNO type before freeing key.data
[unix-history] / 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;