Fix: test libc-wrapper: check malloc OOM
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Nov 2014 17:38:21 +0000 (12:38 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 26 Nov 2014 21:01:17 +0000 (16:01 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/ust/libc-wrapper/prog.c

index b54bb49b410601ff3a771d6976eddccf5a0da1cd..4eb7d48a5925a212df2f971fdcc8ad9e47646873 100644 (file)
@@ -31,6 +31,9 @@ int main(int argc, char **argv)
 
        for (i = 0; i < N_ITER; i++) {
                ptrs[i] = malloc(i+1000);
+               if (!ptrs[i]) {
+                       exit(EXIT_FAILURE);
+               }
 
                memcpy(ptrs[i], teststr, sizeof(teststr));
 
This page took 0.026283 seconds and 4 git commands to generate.