=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/memory.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/make/memory.c 2004/04/07 13:11:36 1.3 +++ src/usr.bin/make/memory.c 2007/09/16 10:43:53 1.4 @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: memory.c,v 1.3 2004/04/07 13:11:36 espie Exp $ */ +/* $OpenBSD: memory.c,v 1.4 2007/09/16 10:43:53 espie Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -42,6 +42,9 @@ #include #include #include +#include +#include +#include #include "defines.h" #include "memory.h" @@ -164,5 +167,16 @@ return -1; } return unlink(file); +} + +void +free_hash(struct ohash *h) +{ + void *e; + unsigned int i; + + for (e = ohash_first(h, &i); e != NULL; e = ohash_next(h, &i)) + free(e); + ohash_delete(h); }