Explorar el Código

Do nothing if free(NULL) is called

Ioannis Koutras hace 12 años
padre
commit
86aae478f3
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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;