aboutsummaryrefslogtreecommitdiff
path: root/string/test-string.h
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2021-07-28 13:03:27 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2021-07-28 17:45:19 +0530
commit70d08ba2046f4e589fdfa0f35999dfd413844bef (patch)
tree0026c2f791e064e35013f82337be9c2a49e6dd4c /string/test-string.h
parentb8e8bb324a376cd99bb61b6c21f63c395cae9b5d (diff)
downloadglibc-70d08ba2046f4e589fdfa0f35999dfd413844bef.zip
glibc-70d08ba2046f4e589fdfa0f35999dfd413844bef.tar.gz
glibc-70d08ba2046f4e589fdfa0f35999dfd413844bef.tar.bz2
tests: use xmalloc to allocate implementation array
The benchmark and tests must fail in case of allocation failure in the implementation array. Also annotate the x* allocators in support.h so that the compiler has more information about them. Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'string/test-string.h')
-rw-r--r--string/test-string.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/string/test-string.h b/string/test-string.h
index febde61..78b66ef 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -18,6 +18,7 @@
<https://www.gnu.org/licenses/>. */
#include <sys/cdefs.h>
+#include <support/support.h>
typedef struct
{
@@ -146,8 +147,8 @@ static impl_t *impl_array;
skip = impl; \
else \
impl_count++; \
- a = impl_array = malloc ((impl_count + func_count) * \
- sizeof (impl_t)); \
+ a = impl_array = xmalloc ((impl_count + func_count) * \
+ sizeof (impl_t)); \
for (impl = __start_impls; impl < __stop_impls; ++impl) \
if (impl != skip) \
*a++ = *impl; \