aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 39cbf88..32eb18a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -44,6 +44,11 @@ void *allocate(size_t size) {
initialize();
}
+ /* special case for a size 0 allocation */
+ if (size == 0) {
+ return NULL;
+ }
+
/*
* pad the requested size to ensure alignment using
* the alignment one-liner we discussed in class