From: Ayush Mittal Date: Thu, 8 Apr 2021 09:29:09 +0000 (+0530) Subject: malloc: remove redundant check of unsorted bin corruption X-Git-Tag: upstream/2.39~1084 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f84f1159e9f3e9716eae46ba88616bb153fdd8c;p=platform%2Fupstream%2Fglibc.git malloc: remove redundant check of unsorted bin corruption * malloc/malloc.c (_int_malloc): remove redundant check of unsorted bin corruption With commit "b90ddd08f6dd688e651df9ee89ca3a69ff88cd0c" (malloc: Additional checks for unsorted bin integrity), same check of (bck->fd != victim) is added before checking of unsorted chunk corruption, which was added in "bdc3009b8ff0effdbbfb05eb6b10966753cbf9b8" (Added check before removing from unsorted list). .. 3773 if (__glibc_unlikely (bck->fd != victim) 3774 || __glibc_unlikely (victim->fd != unsorted_chunks (av))) 3775 malloc_printerr ("malloc(): unsorted double linked list corrupted"); .. .. 3815 /* remove from unsorted list */ 3816 if (__glibc_unlikely (bck->fd != victim)) 3817 malloc_printerr ("malloc(): corrupted unsorted chunks 3"); 3818 unsorted_chunks (av)->bk = bck; .. So this extra check can be removed. Signed-off-by: Maninder Singh Signed-off-by: Ayush Mittal Reviewed-by: DJ Delorie --- diff --git a/malloc/malloc.c b/malloc/malloc.c index fd8b52b..5829f3f 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4034,8 +4034,6 @@ _int_malloc (mstate av, size_t bytes) } /* remove from unsorted list */ - if (__glibc_unlikely (bck->fd != victim)) - malloc_printerr ("malloc(): corrupted unsorted chunks 3"); unsorted_chunks (av)->bk = bck; bck->fd = unsorted_chunks (av);