From d7e68c96b46599c7f3277d04ec4d1107ac2ff594 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 6 Apr 2016 13:50:16 +0200 Subject: malloc: Fix early realloc() allocation --- testsuites/libtests/malloctest/init.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'testsuites/libtests/malloctest') diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c index acf25d7cc5..6123977ff7 100644 --- a/testsuites/libtests/malloctest/init.c +++ b/testsuites/libtests/malloctest/init.c @@ -1375,6 +1375,9 @@ static void test_early_malloc( void ) { void *p; char *q; + void *r; + void *s; + void *t; p = malloc( 1 ); rtems_test_assert( p != NULL ); @@ -1387,6 +1390,20 @@ static void test_early_malloc( void ) rtems_test_assert( q[0] == 0 ); free( q ); + + r = realloc( q, 128 ); + rtems_test_assert( r == q ); + + s = malloc( 1 ); + rtems_test_assert( s != NULL ); + + free( s ); + + t = realloc( r, 256 ); + rtems_test_assert( t != NULL ); + rtems_test_assert( t != r ); + + free( t ); } RTEMS_SYSINIT_ITEM( -- cgit v1.2.3