add: tab_free

This commit is contained in:
starnakin 2023-06-29 11:44:58 +02:00
parent da8cce7750
commit 1fb424e7ad
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#pragma once
#include <stdlib.h>
#include <stddef.h>
size_t tablen(const void** tab);
void tab_free(void** tab);

8
src/tab/tab_free.c Normal file
View File

@ -0,0 +1,8 @@
#include "tab.h"
void tab_free(void** tab)
{
for (size_t i = 0; tab[i] != NULL; i++)
free(tab[i]);
free(tab);
}