From 6caae98cbb0f4adc050b36a56ad8d50ecc1445ff Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 26 Jul 2017 14:09:52 -0400 Subject: [PATCH] Fix: add missing goto end on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Found by Coverity: CID 1376168 (#1 of 1): Dereference after null check (FORWARD_NULL)7. var_deref_model: Passing null pointer debug_info_component->arg_debug_info_field_name to sprintf, which dereferences it. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- plugins/lttng-utils/plugin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/lttng-utils/plugin.c b/plugins/lttng-utils/plugin.c index 163231376..58956981c 100644 --- a/plugins/lttng-utils/plugin.c +++ b/plugins/lttng-utils/plugin.c @@ -364,6 +364,7 @@ enum bt_component_status init_from_params( if (!debug_info_component->arg_debug_info_field_name) { ret = BT_COMPONENT_STATUS_NOMEM; BT_LOGE_STR("Missing field name."); + goto end; } sprintf(debug_info_component->arg_debug_info_field_name, "debug_info"); -- 2.34.1