Browse Source

Provide a dealloc function

master
Con Kolivas 11 years ago
parent
commit
3dd6e6bcb5
  1. 6
      src/libckpool.c
  2. 1
      src/libckpool.h

6
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)
{

1
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);

Loading…
Cancel
Save