2009-11-16 17:17:15 +01:00
|
|
|
Test malloc, set unused to NULL if it fails
|
|
|
|
|
2008-08-28 12:39:19 +02:00
|
|
|
---
|
|
|
|
tests/heapshrink-helper.c | 4 +++-
|
|
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
--- a/tests/heapshrink-helper.c
|
|
|
|
+++ b/tests/heapshrink-helper.c
|
|
|
|
@@ -21,5 +21,7 @@
|
|
|
|
|
|
|
|
static void __attribute__((constructor)) setup_heapshrink_helper(void)
|
|
|
|
{
|
|
|
|
- (void) malloc(1);
|
|
|
|
+ void *unused = malloc(1);
|
|
|
|
+ if (unused)
|
|
|
|
+ unused = NULL;
|
|
|
|
}
|