Merge branch 'collectd-4.4'
[collectd.git] / src / common.h
index a5e2167..119cee6 100644 (file)
 #endif
 
 #define sfree(ptr) \
-       if((ptr) != NULL) { \
-               free(ptr); \
-       } \
-       (ptr) = NULL
+       do { \
+               if((ptr) != NULL) { \
+                       free(ptr); \
+               } \
+               (ptr) = NULL; \
+       } while (0)
 
 #define STATIC_ARRAY_SIZE(a) (sizeof (a) / sizeof (*(a)))