diff options
author | tdeval <> | 2004-08-04 19:12:53 +0000 |
---|---|---|
committer | tdeval <> | 2004-08-04 19:12:53 +0000 |
commit | c83fda0075d86da98f69b2e750005da6bf478117 (patch) | |
tree | 46b994250ad45d257013bd9a12b5ef5268e2524f | |
parent | 415f261db2ca71bc85aa7ef5d1e11cfe431f0a9b (diff) | |
download | openbsd-c83fda0075d86da98f69b2e750005da6bf478117.tar.gz openbsd-c83fda0075d86da98f69b2e750005da6bf478117.tar.bz2 openbsd-c83fda0075d86da98f69b2e750005da6bf478117.zip |
Missing check for NULL.
-rw-r--r-- | src/lib/libc/stdlib/malloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #if defined(LIBC_SCCS) && !defined(lint) | 10 | #if defined(LIBC_SCCS) && !defined(lint) |
11 | static char rcsid[] = "$OpenBSD: malloc.c,v 1.68 2004/08/01 08:45:39 tdeval Exp $"; | 11 | static char rcsid[] = "$OpenBSD: malloc.c,v 1.69 2004/08/04 19:12:53 tdeval Exp $"; |
12 | #endif /* LIBC_SCCS and not lint */ | 12 | #endif /* LIBC_SCCS and not lint */ |
13 | 13 | ||
14 | /* | 14 | /* |
@@ -1348,7 +1348,7 @@ free_pages(void *ptr, u_long index, struct pginfo *info) | |||
1348 | index = ptr2index(malloc_brk); | 1348 | index = ptr2index(malloc_brk); |
1349 | 1349 | ||
1350 | pidx = PI_IDX(index); | 1350 | pidx = PI_IDX(index); |
1351 | if (PD_IDX(prev_dir->dirnum) >= pidx) | 1351 | if (prev_dir != NULL && PD_IDX(prev_dir->dirnum) >= pidx) |
1352 | prev_dir = NULL; /* Will be wiped out below ! */ | 1352 | prev_dir = NULL; /* Will be wiped out below ! */ |
1353 | 1353 | ||
1354 | for (pi=pf->pdir; pi!=NULL && PD_IDX(pi->dirnum)<pidx; pi=pi->next); | 1354 | for (pi=pf->pdir; pi!=NULL && PD_IDX(pi->dirnum)<pidx; pi=pi->next); |