Fix: add missing goto end on error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Jul 2017 18:09:52 +0000 (14:09 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 Aug 2017 22:00:20 +0000 (18:00 -0400)
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 <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/lttng-utils/plugin.c

index 16323137655f1f0c42ab738cc568f2170fcf0de8..58956981c8ef6450ff8f29a3b35cc8ca3453ed3a 100644 (file)
@@ -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");
This page took 0.025704 seconds and 4 git commands to generate.