Parcourir la source

Do nothing if free(NULL) is called

Ioannis Koutras il y a 12 ans
Parent
commit
86aae478f3
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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;