summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1996-09-17 19:50:23 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1996-09-17 19:50:23 +0000
commit89e3b80fa246cbf381798c2a56e42794f7d90a4b (patch)
treeb0e12a164e41e8fa879aaf7e0f907f1da473e5b7 /lib/libc/stdlib/malloc.c
parentd45496e5c449239e283b6dd100ddad5764824a3f (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index e8543e438864..2d5d73de3d65 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: malloc.c,v 1.10 1996/01/22 00:01:44 julian Exp $
+ * $Id: malloc.c,v 1.11 1996/07/03 05:03:07 phk Exp $
*
*/
@@ -942,7 +942,7 @@ static __inline void
free_pages(void *ptr, int index, struct pginfo *info)
{
int i;
- struct pgfree *pf,*pt;
+ struct pgfree *pf,*pt=0;
u_long l;
void *tail;
@@ -1013,7 +1013,6 @@ free_pages(void *ptr, int index, struct pginfo *info)
pf->next = pt->next;
if (pf->next)
pf->next->prev = pf;
- free(pt);
}
} else if (pf->page == tail) {
/* Prepend to entry */
@@ -1055,6 +1054,8 @@ free_pages(void *ptr, int index, struct pginfo *info)
/* XXX: We could realloc/shrink the pagedir here I guess. */
}
+ if (pt)
+ free(pt);
}
/*