diff options
author | Thierry Deval <tdeval@cvs.openbsd.org> | 2004-08-04 19:12:54 +0000 |
---|---|---|
committer | Thierry Deval <tdeval@cvs.openbsd.org> | 2004-08-04 19:12:54 +0000 |
commit | d05645302fef3101dfcbcd5c441dbf64a9614537 (patch) | |
tree | b4171db66cfd37549d3e6c096b3b7c9737215e3d /lib/libc/stdlib | |
parent | 730cbbc6238dda5afdac4bd0f874349dfb363250 (diff) |
Missing check for NULL.
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 139c99aa6d1..6e5d60542ce 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -8,7 +8,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: malloc.c,v 1.68 2004/08/01 08:45:39 tdeval Exp $"; +static char rcsid[] = "$OpenBSD: malloc.c,v 1.69 2004/08/04 19:12:53 tdeval Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -1348,7 +1348,7 @@ free_pages(void *ptr, u_long index, struct pginfo *info) index = ptr2index(malloc_brk); pidx = PI_IDX(index); - if (PD_IDX(prev_dir->dirnum) >= pidx) + if (prev_dir != NULL && PD_IDX(prev_dir->dirnum) >= pidx) prev_dir = NULL; /* Will be wiped out below ! */ for (pi=pf->pdir; pi!=NULL && PD_IDX(pi->dirnum)<pidx; pi=pi->next); |