diff --git a/src/utils.c b/src/utils.c index 55840369..2b0f052b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -263,6 +263,17 @@ ss_align(size_t size) } } +void +ss_free(void *ptr) +{ +#ifdef __MINGW32__ + _aligned_free(ptr); +#else + free(ptr); +#endif + ptr = NULL; +} + void * ss_realloc(void *ptr, size_t new_size) { diff --git a/src/utils.h b/src/utils.h index cbe5972a..b5d501b6 100644 --- a/src/utils.h +++ b/src/utils.h @@ -229,15 +229,10 @@ int set_nofile(int nofile); void *ss_malloc(size_t size); void *ss_align(size_t size); void *ss_realloc(void *ptr, size_t new_size); +void ss_free(void *ptr); int ss_is_ipv6addr(const char *addr); -#define ss_free(ptr) \ - do { \ - free(ptr); \ - ptr = NULL; \ - } while (0) - char *get_default_conf(void); #endif // _UTILS_H