ZERO_STRUCTP does not check argument for NULL.
authorLuke Leighton <lkcl@samba.org>
Fri, 13 Nov 1998 17:26:44 +0000 (17:26 +0000)
committerLuke Leighton <lkcl@samba.org>
Fri, 13 Nov 1998 17:26:44 +0000 (17:26 +0000)
ZERO_STRUCTPN _does_ check argument for NULL.
(This used to be commit 0be34ca1402f95506680caa3461e94d4ae54bb7d)

source3/include/smb.h

index bb055214ec540b246026e6018d1533ab8fb86d02..acbd56d81e1374443cc684892580efb72beccb5f 100644 (file)
@@ -1655,7 +1655,10 @@ extern int unix_ERR_code;
 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
 
 /* zero a structure given a pointer to the structure */
-#define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
+#define ZERO_STRUCTP(x) memset((char *)(x), 0, sizeof(*(x))
+
+/* zero a structure given a pointer to the structure */
+#define ZERO_STRUCTPN(x) { if ((x) != NULL) ZERO_STRUCTP(x); }
 
 /* zero an array - note that sizeof(array) must work - ie. it must not be a 
    pointer */