diff --git a/src/libckpool.c b/src/libckpool.c index f4b7a1f8..c42876ba 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -422,6 +422,12 @@ void realloc_strcat(char **ptr, const char *s) sprintf(ofs, "%s", s); } +void dealloc(void **ptr) +{ + free(*ptr); + *ptr = NULL; +} + /* Adequate size s==len*2 + 1 must be alloced to use this variant */ void __bin2hex(uchar *s, const uchar *p, size_t len) { diff --git a/src/libckpool.h b/src/libckpool.h index 3ad47866..5eec0913 100644 --- a/src/libckpool.h +++ b/src/libckpool.h @@ -141,6 +141,7 @@ int connect_socket(char *url, char *port); void align_len(size_t *len); void realloc_strcat(char **ptr, const char *s); +void dealloc(void **ptr); void __bin2hex(uchar *s, const uchar *p, size_t len); void *bin2hex(const uchar *p, size_t len); bool hex2bin(uchar *p, const uchar *hexstr, size_t len);