diff --git a/srcs/ft_free.c b/srcs/ft_free.c index 7759e30..22cddec 100644 --- a/srcs/ft_free.c +++ b/srcs/ft_free.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* ft_free.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: thrieg +#+ +:+ +#+ */ +/* By: thrieg < thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/11/19 15:44:05 by thrieg #+# #+# */ -/* Updated: 2025/12/13 06:52:01 by thrieg ### ########.fr */ +/* Updated: 2025/12/15 15:54:45 by thrieg ### ########.fr */ /* */ /* ************************************************************************** */ @@ -89,17 +89,14 @@ void free(void *ptr) pthread_mutex_unlock(&g_mut); return; } - else if (header->zone->type == E_SMALL) + else if (header->zone->type == E_SMALL || header->zone->type == E_TINY) { header->occupied = false; if (defrag_zone(header->zone)) - return; //zone munmaped, avoid all other logic on this memory - } - else if (header->zone->type == E_TINY) - { - header->occupied = false; - if (defrag_zone(header->zone)) - return; //zone munmaped, avoid all other logic on this memory + { + pthread_mutex_unlock(&g_mut); + return; // zone munmaped, avoid all other logic on this memory + } } else {