talloc: clarify that talloc_magic never includes the bits in TALLOC_FLAG_MASK
authorAndrew Bartlett <abartlet@samba.org>
Tue, 22 Nov 2016 21:26:14 +0000 (10:26 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 1 Dec 2016 04:54:22 +0000 (05:54 +0100)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/talloc/talloc.c

index a097ce088df2273047373697dbb5ad5024ceee4d..279021c137a65151d92d9df14fe9e4abcf8502a1 100644 (file)
 
 #define TALLOC_MAGIC_BASE 0xe814ec70
 static unsigned int talloc_magic = (
-       TALLOC_MAGIC_BASE +
-       (TALLOC_VERSION_MAJOR << 12) +
-       (TALLOC_VERSION_MINOR << 4));
+       ~TALLOC_FLAG_MASK & (
+               TALLOC_MAGIC_BASE +
+               (TALLOC_VERSION_MAJOR << 12) +
+               (TALLOC_VERSION_MINOR << 4)));
 
 /* by default we abort when given a bad pointer (such as when talloc_free() is called
    on a pointer that came from malloc() */