projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
src/common.h: Make sfree() usable like a function.
[collectd.git]
/
src
/
common.h
diff --git
a/src/common.h
b/src/common.h
index
e99aea6
..
9e7e4aa
100644
(file)
--- 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)))