X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftalloc%2Ftalloc.c;h=d02eee772784a07a4afe84ec1270bc0da163f599;hp=0c6bcda955165e5cb088ec9dadd9da5863c95676;hb=HEAD;hpb=c520b4adbbfba5a663b94e71216b90eddd0bf877 diff --git a/ccan/talloc/talloc.c b/ccan/talloc/talloc.c index 0c6bcda9..d02eee77 100644 --- a/ccan/talloc/talloc.c +++ b/ccan/talloc/talloc.c @@ -621,7 +621,7 @@ static inline int talloc_unreference(const void *context, const void *ptr) /* remove a specific parent context from a pointer. This is a more - controlled varient of talloc_free() + controlled variant of talloc_free() */ int talloc_unlink(const void *context, void *ptr) { @@ -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;