]> 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, 19 Mar 2021 11:46:21 +0000 (11:46 +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.

malloc/malloc.c

index 03eb0f40fa52182a49944f8fbfd9d885356ea2d0..34884808e2a430aa0d0c7f2b1274e7a6ac1c40ab 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.049312 seconds and 5 git commands to generate.