Browse Source

Do nothing if free(NULL) is called

Ioannis Koutras 12 years ago
parent
commit
86aae478f3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/dmmlib.c

+ 4 - 0
src/dmmlib.c

@@ -89,6 +89,10 @@ void free(void *ptr) {
     raw_block_header_t *current_raw_block;
     bool found;
 
+    if(ptr == NULL) {
+        return;
+    }
+
     found = false;
 
     current_raw_block = systemallocator.raw_block_head;