From: Jérémie Galarneau Date: Fri, 31 Jan 2020 23:06:09 +0000 (-0500) Subject: Clean-up: unchecked return value X-Git-Tag: v2.12.0-rc1~8 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9ac61dbdc19140c00f345aae570f18abbe079852;p=lttng-tools.git Clean-up: unchecked return value The return value of lttng_dynamic_buffer_set_size() is ignored in lttng_dynamic_array_clear(). It is okay as lttng_dynamic_buffer_set_size(..., 0) can't fail. However, it results in a Coverity Scan warning. 1412201 Unchecked return value If the function returns an error value, the error value may be mistaken for a normal value. In lttng_dynamic_array_clear: Value returned from a function is not checked for errors before being used (CWE-252) Reported-by: Coverity Scan Signed-off-by: Jérémie Galarneau Change-Id: I1943e299e4cb5752711f2d25b0dd9a5c44a28a18 --- diff --git a/src/common/dynamic-array.c b/src/common/dynamic-array.c index f737c982d..198df19bb 100644 --- a/src/common/dynamic-array.c +++ b/src/common/dynamic-array.c @@ -89,7 +89,7 @@ void lttng_dynamic_array_clear(struct lttng_dynamic_array *array) } } - lttng_dynamic_buffer_set_size(&array->buffer, 0); + (void) lttng_dynamic_buffer_set_size(&array->buffer, 0); array->size = 0; }