From: Mathieu Desnoyers Date: Thu, 3 Aug 2017 13:43:29 +0000 (-0400) Subject: Fix: unchecked return value X-Git-Tag: v2.0.0-pre4~170 X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;ds=sidebyside;h=849b61927961987c0ec357de753d8e0e4a9b92b2;p=babeltrace.git Fix: unchecked return value 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 --- 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