From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 17:39:13 +0000 (-0500) Subject: Fix: test test_ust_data.c: check OOM X-Git-Tag: v2.4.3~6 X-Git-Url: http://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=5ad8632584a38459f47372900b7a20b3ec5608da Fix: test test_ust_data.c: check OOM Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c index d07e9347d..a0e878bf4 100644 --- a/tests/unit/test_ust_data.c +++ b/tests/unit/test_ust_data.c @@ -39,7 +39,7 @@ #define RANDOM_STRING_LEN 11 /* Number of TAP tests in this file */ -#define NUM_TESTS 10 +#define NUM_TESTS 11 /* For error.h */ int lttng_opt_quiet = 1; @@ -156,6 +156,12 @@ static void test_create_ust_event_exclusion(void) /* set up an exclusion set */ exclusion = zmalloc(sizeof(*exclusion) + LTTNG_SYMBOL_NAME_LEN); + if (!exclusion) { + PERROR("zmalloc"); + } + + ok(exclusion != NULL, "Create UST exclusion"); + exclusion->count = 1; strncpy((char *)(exclusion->names), get_random_string(), LTTNG_SYMBOL_NAME_LEN);