Fix: handle close return value
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 18 Jun 2013 19:34:31 +0000 (15:34 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 19 Jun 2013 18:47:22 +0000 (14:47 -0400)
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 <mathieu.desnoyers@efficios.com>
src/lib/lttng-ctl/lttng-ctl.c

index a7328ebfd8fa4e35d2f067d6affc01e832e6f13b..6c8ad411a3ab7de446f8a8bdda20c4b552dad6b6 100644 (file)
@@ -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;
This page took 0.02892 seconds and 4 git commands to generate.