Add zfree

This commit is contained in:
Johan Malm 2021-02-21 21:59:53 +00:00
parent 1b263e1f67
commit 9f61a819fc
4 changed files with 27 additions and 15 deletions

View file

@ -7,4 +7,5 @@ labwc_sources += files(
'nodename.c',
'spawn.c',
'string-helpers.c',
'zfree.c',
)

11
src/common/zfree.c Normal file
View file

@ -0,0 +1,11 @@
#include <stdlib.h>
#include "common/zfree.h"
void __zfree(void **ptr)
{
if (!ptr || !*ptr) {
return;
}
free(*ptr);
*ptr = NULL;
}