]> git.ozlabs.org Git - ccan/blobdiff - ccan/talloc/talloc.c
talloc: avoid a comparison mismatch & at the same time switch to non-legacy sysconf()
[ccan] / ccan / talloc / talloc.c
index 0c6bcda955165e5cb088ec9dadd9da5863c95676..3ada60fca562566aa2207f8ed73c8eae34f24652 100644 (file)
@@ -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;