From 6738b0f5bbb0f273a88b76884982a5a32215a5f5 Mon Sep 17 00:00:00 2001 From: starnakin Date: Wed, 31 Jul 2024 12:30:33 +0200 Subject: [PATCH] free null ptr do nothing --- src/malloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/malloc.c b/src/malloc.c index 1ac5bcf..d48b053 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -117,6 +117,9 @@ void ft_free(void *ptr) chunk_t chunk; size_t i; + if (ptr == NULL) + return; + for (i = TINY; i <= LARGE + 1; i++) { if (i > LARGE)