From c83fda0075d86da98f69b2e750005da6bf478117 Mon Sep 17 00:00:00 2001 From: tdeval <> Date: Wed, 4 Aug 2004 19:12:53 +0000 Subject: Missing check for NULL. --- src/lib/libc/stdlib/malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index 139c99aa6d..6e5d60542c 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/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)next); -- cgit v1.2.3-55-g6feb