libhugetlbfs/libhugetlbfs.tests-malloc.patch
OBS User autobuild 2e4491a314 Accepting request 24429 from Base:System
Copy from Base:System/libhugetlbfs based on submit request 24429 from user msmeissn

OBS-URL: https://build.opensuse.org/request/show/24429
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libhugetlbfs?expand=0&rev=13
2009-11-16 16:17:15 +00:00

18 lines
379 B
Diff

Test malloc, set unused to NULL if it fails
---
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;
}