Commit 426bd7e6 authored by Cody P Schafer's avatar Cody P Schafer Committed by Rusty Russell

talloc: avoid a comparison mismatch & at the same time switch to non-legacy sysconf()

Without this, gcc warns about a sign mismatch in the comparison.
Signed-off-by: default avatarCody P Schafer <dev@codyps.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent d8837230
......@@ -810,7 +810,7 @@ void *_talloc(const void *context, size_t size)
static int talloc_destroy_pointer(void ***pptr)
{
if ((uintptr_t)**pptr < getpagesize())
if ((uintptr_t)**pptr < (uintptr_t)sysconf(_SC_PAGESIZE))
TALLOC_ABORT("Double free or invalid talloc_set?");
/* Invalidate pointer so it can't be used again. */
**pptr = (void *)1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment