add: tab_free
This commit is contained in:
parent
da8cce7750
commit
1fb424e7ad
@ -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
8
src/tab/tab_free.c
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user