From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 17:38:21 +0000 (-0500) Subject: Fix: test libc-wrapper: check malloc OOM X-Git-Tag: v2.5.3~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0c3467d42dbf70aa6b7cb4d63910f1bf5122b930;p=lttng-tools.git Fix: test libc-wrapper: check malloc OOM Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/ust/libc-wrapper/prog.c b/tests/regression/ust/libc-wrapper/prog.c index 3068257f8..a922211f7 100644 --- a/tests/regression/ust/libc-wrapper/prog.c +++ b/tests/regression/ust/libc-wrapper/prog.c @@ -31,6 +31,9 @@ int main() for (i = 0; i < N_ITER; i++) { ptrs[i] = malloc(i+1000); + if (!ptrs[i]) { + exit(EXIT_FAILURE); + } memcpy(ptrs[i], teststr, sizeof(teststr));