From: Mathieu Desnoyers Date: Sat, 20 Aug 2011 20:28:00 +0000 (-0400) Subject: Add missing error handling in liblttngctl X-Git-Tag: v2.0-pre13~19^2~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=007953922e4d3f9f96b896cddb1c4dceddccc26e;p=lttng-tools.git Add missing error handling in liblttngctl Signed-off-by: Mathieu Desnoyers --- 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");