mirror of
https://github.com/samba-team/samba.git
synced 2025-12-13 16:23:50 +03:00
introduce SAFE_FREE() macro as suggested by andreas moroder.
This commit is contained in:
@@ -37,6 +37,9 @@
|
||||
#define IS_DOS_SYSTEM(test_mode) (((test_mode) & aSYSTEM) != 0)
|
||||
#define IS_DOS_HIDDEN(test_mode) (((test_mode) & aHIDDEN) != 0)
|
||||
|
||||
/* free memory if the pointer is valid and zero the pointer */
|
||||
#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
|
||||
|
||||
/* zero a structure */
|
||||
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user