X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcommon.h;fp=src%2Fcommon.h;h=119cee6dcc2952cb640df0af01d4a63bed5420e2;hb=148e8732e45435a051df1c3673cad0d5dc77492f;hp=a5e2167b6c1e3565a96d2e399aee0616923f3133;hpb=6a968db27aab6d8c4cfe4f6e4c5bf3183eb84794;p=collectd.git diff --git a/src/common.h b/src/common.h index a5e2167b..119cee6d 100644 --- a/src/common.h +++ b/src/common.h @@ -31,10 +31,12 @@ #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)))