1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

(memalign_check): No need to use checked_request2size.

This commit is contained in:
Ulrich Drepper
2011-07-08 13:20:41 -04:00
parent 04d08991c4
commit 8538fdb3ec
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2011-07-08 Ulrich Drepper <drepper@gmail.com>
* malloc/hooks.c (memalign_check): Avoid using checked_request2size
if the result is not used.
2011-07-05 Andreas Jaeger <aj@suse.de> 2011-07-05 Andreas Jaeger <aj@suse.de>
[BZ#9696] [BZ#9696]

View File

@ -1,5 +1,5 @@
/* Malloc implementation for multiple threads without lock contention. /* Malloc implementation for multiple threads without lock contention.
Copyright (C) 2001-2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copyright (C) 2001-2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Wolfram Gloger <wg@malloc.de>, 2001. Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
@ -398,7 +398,6 @@ memalign_check(alignment, bytes, caller)
size_t alignment; size_t bytes; const Void_t *caller; size_t alignment; size_t bytes; const Void_t *caller;
#endif #endif
{ {
INTERNAL_SIZE_T nb;
Void_t* mem; Void_t* mem;
if (alignment <= MALLOC_ALIGNMENT) return malloc_check(bytes, NULL); if (alignment <= MALLOC_ALIGNMENT) return malloc_check(bytes, NULL);
@ -408,7 +407,6 @@ memalign_check(alignment, bytes, caller)
MALLOC_FAILURE_ACTION; MALLOC_FAILURE_ACTION;
return NULL; return NULL;
} }
checked_request2size(bytes+1, nb);
(void)mutex_lock(&main_arena.mutex); (void)mutex_lock(&main_arena.mutex);
mem = (top_check() >= 0) ? _int_memalign(&main_arena, alignment, bytes+1) : mem = (top_check() >= 0) ? _int_memalign(&main_arena, alignment, bytes+1) :
NULL; NULL;