From: Mathieu Desnoyers Date: Tue, 18 Jun 2013 19:34:31 +0000 (-0400) Subject: Fix: handle close return value X-Git-Tag: v2.2.0-rc3~14 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=67ef15b7484912e08bcea1f68d8076b5b8772c12;p=lttng-tools.git Fix: handle close return value 1019968 Unchecked return value In lttng_health_check: Value returned from a function is not checked for errors before being used (CWE-252) Signed-off-by: Mathieu Desnoyers --- diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index a7328ebfd..6c8ad411a 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1599,7 +1599,12 @@ int lttng_health_check(enum lttng_health_component c) ret = reply.ret_code; close_error: - close(sock); + { + int closeret; + + closeret = close(sock); + assert(!closeret); + } error: return ret;