From 1ba2329b35a95300e3eb4df5501da6980e40b7d9 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 3 Aug 2017 09:43:29 -0400 Subject: [PATCH] Fix: unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Found by Coverity: CID 1376155 (#1 of 1): Unchecked return value (CHECKED_RETURN). check_return: Calling bt_value_string_get without checking return value (as is done elsewhere 44 out of 47 times). Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- cli/babeltrace.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/babeltrace.c b/cli/babeltrace.c index f4bb4a91..540bd11d 100644 --- a/cli/babeltrace.c +++ b/cli/babeltrace.c @@ -595,10 +595,15 @@ int load_dynamic_plugins(struct bt_value *plugin_paths) struct bt_value *plugin_path_value = NULL; const char *plugin_path; struct bt_plugin_set *plugin_set; + enum bt_value_status status; plugin_path_value = bt_value_array_get(plugin_paths, i); - bt_value_string_get(plugin_path_value, &plugin_path); - assert(plugin_path); + status = bt_value_string_get(plugin_path_value, &plugin_path); + if (status != BT_VALUE_STATUS_OK) { + BT_LOGD_STR("Cannot get plugin path string."); + BT_PUT(plugin_path_value); + continue; + } /* * Skip this if the directory does not exist because -- 2.34.1