From 8cc2eea0931dde774454fea0eafa385bc16fc73b Mon Sep 17 00:00:00 2001 From: Parichay Kapoor Date: Mon, 10 Feb 2020 17:10:48 +0900 Subject: [PATCH] [single/coverity] Coverity fix Added coverity fix of checking return value In ml_single_set_info_in_handle: Value returned from a function is not checked for errors before being used (CWE-252) Signed-off-by: Parichay Kapoor --- api/capi/src/nnstreamer-capi-single.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/capi/src/nnstreamer-capi-single.c b/api/capi/src/nnstreamer-capi-single.c index 082cae5..e05f24f 100644 --- a/api/capi/src/nnstreamer-capi-single.c +++ b/api/capi/src/nnstreamer-capi-single.c @@ -353,6 +353,7 @@ static gboolean ml_single_set_info_in_handle (ml_single_h single, gboolean is_input, ml_tensors_info_s * tensors_info) { + int status; ml_single *single_h; ml_tensors_info_h info = NULL; ml_tensors_info_s *dest; @@ -395,7 +396,9 @@ ml_single_set_info_in_handle (ml_single_h single, gboolean is_input, ml_tensors_info_clone (dest, info); ml_tensors_info_destroy (info); } else if (tensors_info) { - ml_single_set_inout_tensors_info (filter_obj, is_input, tensors_info); + status = ml_single_set_inout_tensors_info (filter_obj, is_input, tensors_info); + if (status != ML_ERROR_NONE) + goto done; ml_tensors_info_clone (dest, tensors_info); } -- 2.7.4