projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test for DB_RECNO type before freeing key.data
[unix-history]
/
usr
/
src
/
lib
/
libc
/
db
/
test
/
dbtest.c
diff --git
a/usr/src/lib/libc/db/test/dbtest.c
b/usr/src/lib/libc/db/test/dbtest.c
index
792ce94
..
cef7e0c
100644
(file)
--- a/
usr/src/lib/libc/db/test/dbtest.c
+++ b/
usr/src/lib/libc/db/test/dbtest.c
@@
-12,7
+12,7
@@
char copyright[] =
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)dbtest.c 5.1
2
(Berkeley) %G%";
+static char sccsid[] = "@(#)dbtest.c 5.1
3
(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;