summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-03-25 19:08:49 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-03-25 19:08:49 +0000
commitff777a25b005ea3d27fe4c5687196702704bcf90 (patch)
treec72827fe97a2c7ef0587fd5914ed445bf8a531b2 /lib
parent2920a09cdc61c119ffeeb28fece74e30ed4ebe50 (diff)
Fix temporary buffer memory leak with big hash keys and data;
Christopher L. Cousins
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/db/hash/hash.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index 943ea0169cf..9889d4d33ff 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hash.c,v 1.13 2002/02/25 23:45:15 millert Exp $ */
+/* $OpenBSD: hash.c,v 1.14 2002/03/25 19:08:48 millert Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94";
#else
-static char rcsid[] = "$OpenBSD: hash.c,v 1.13 2002/02/25 23:45:15 millert Exp $";
+static char rcsid[] = "$OpenBSD: hash.c,v 1.14 2002/03/25 19:08:48 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -435,6 +435,10 @@ hdestroy(hashp)
for (i = 0; i < hashp->nmaps; i++)
if (hashp->mapp[i])
free(hashp->mapp[i]);
+ if (hashp->tmp_key)
+ free(hashp->tmp_key);
+ if (hashp->tmp_buf)
+ free(hashp->tmp_buf);
if (hashp->fp != -1)
(void)close(hashp->fp);