projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd7b9ef
)
free() on a null pointer is a no-op.
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 5 Sep 2004 08:14:23 +0000
(08:14 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 5 Sep 2004 08:14:23 +0000
(08:14 +0000)
src/threads/malloc.c
patch
|
blob
|
history
diff --git
a/src/threads/malloc.c
b/src/threads/malloc.c
index 02eee99fca15b47eed79863a08f7765b5c5ce533..7af11563795e925884ecc56269bf5eb8e5950f00 100644
(file)
--- a/
src/threads/malloc.c
+++ b/
src/threads/malloc.c
@@
-164,6
+164,9
@@
free (void *p)
struct arena *a = block_to_arena (b);
struct desc *d = a->desc;
+ if (p == NULL)
+ return;
+
lock_acquire (&d->lock);
/* Add block to free list. */