From: Mathieu Desnoyers Date: Wed, 26 Jul 2017 18:09:52 +0000 (-0400) Subject: Fix: add missing goto end on error X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=6caae98cbb0f4adc050b36a56ad8d50ecc1445ff;p=deliverable%2Fbabeltrace.git Fix: add missing goto end on error 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 --- 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");