]> sourceware.org Git - glibc.git/commitdiff
malloc: Use different tag after mremap
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 12 Mar 2021 09:46:15 +0000 (09:46 +0000)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 26 Mar 2021 11:03:06 +0000 (11:03 +0000)
The comment explained why different tag is used after mremap, but
for that correctly tagged pointer should be passed to tag_new_usable.
Use chunk2mem to get the tag.

Reviewed-by: DJ Delorie <dj@redhat.com>
malloc/malloc.c

index a2c550df0665787cd7b2312471c9cf00d4c5fad3..ebcf1ff9603dda00a4dc810c2ff67cf69facab7d 100644 (file)
@@ -3411,7 +3411,7 @@ __libc_realloc (void *oldmem, size_t bytes)
       newp = mremap_chunk (oldp, nb);
       if (newp)
        {
-         void *newmem = chunk2rawmem (newp);
+         void *newmem = chunk2mem (newp);
          /* Give the new block a different tag.  This helps to ensure
             that stale handles to the previous mapping are not
             reused.  There's a performance hit for both us and the
This page took 0.050564 seconds and 5 git commands to generate.