X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmalloc%2Fmalloc.c;h=1a1a51f4150187d691ef1aca19f95e496377b73b;hb=ede353d8e5c9198cf467aad95e49a496020898ed;hp=46cc21fb7b54ed95310c51e7ac0ee6a285ff5532;hpb=b761bd19aa1ae0f95dd2146397b7f39b44a471b6;p=musl diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c index 46cc21fb..1a1a51f4 100644 --- a/src/malloc/malloc.c +++ b/src/malloc/malloc.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include #include @@ -394,7 +395,7 @@ void *realloc(void *p, size_t n) size_t oldlen = n0 + extra; size_t newlen = n + extra; /* Crash on realloc of freed chunk */ - if ((uintptr_t)base < mal.brk) *(char *)0=0; + if ((uintptr_t)base < mal.brk) *(volatile char *)0=0; if (newlen < PAGE_SIZE && (new = malloc(n))) { memcpy(new, p, n-OVERHEAD); free(p); @@ -457,7 +458,7 @@ void free(void *p) char *base = (char *)self - extra; size_t len = CHUNK_SIZE(self) + extra; /* Crash on double free */ - if ((uintptr_t)base < mal.brk) *(char *)0=0; + if ((uintptr_t)base < mal.brk) *(volatile char *)0=0; __munmap(base, len); return; }