From da4fc746ed6f146ac9e714f22ef976a8ec7b0f8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 9 Aug 2017 15:46:47 -0400 Subject: [PATCH] Fix: wrong variable checked for NULL after allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Found by Coverity: writer_component->base_path = g_string_new(path); notnull: At condition writer_component, the value of writer_component cannot be NULL. dead_error_condition: The condition !writer_component cannot be true. CID 1376158 (#1 of 1): Logically dead code (DEADCODE)dead_error_begin: Execution cannot reach this statement: ret = BT_COMPONENT_STATUS_E.. Signed-off-by: Jérémie Galarneau --- plugins/ctf/fs-sink/writer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ctf/fs-sink/writer.c b/plugins/ctf/fs-sink/writer.c index ae30a84b3..fd2c1632d 100644 --- a/plugins/ctf/fs-sink/writer.c +++ b/plugins/ctf/fs-sink/writer.c @@ -351,7 +351,7 @@ enum bt_component_status writer_component_init( bt_put(value); writer_component->base_path = g_string_new(path); - if (!writer_component) { + if (!writer_component->base_path) { ret = BT_COMPONENT_STATUS_ERROR; goto error; } -- 2.34.1