From 007953922e4d3f9f96b896cddb1c4dceddccc26e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 20 Aug 2011 16:28:00 -0400 Subject: [PATCH] Add missing error handling in liblttngctl Signed-off-by: Mathieu Desnoyers --- liblttngctl/lttngctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/liblttngctl/lttngctl.c b/liblttngctl/lttngctl.c index 42f3ad2ae..c2b1242d8 100644 --- a/liblttngctl/lttngctl.c +++ b/liblttngctl/lttngctl.c @@ -153,6 +153,10 @@ static int check_tracing_group(const char *grp_name) /* Alloc group list of the right size */ grp_list = malloc(grp_list_size * sizeof(gid_t)); + if (!grp_list) { + ret = -1; + goto end; + } grp_id = getgroups(grp_list_size, grp_list); if (grp_id < -1) { perror("getgroups"); -- 2.34.1