From: Jérémie Galarneau Date: Wed, 9 Aug 2017 19:46:47 +0000 (-0400) Subject: Fix: wrong variable checked for NULL after allocation X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=da4fc746ed6f146ac9e714f22ef976a8ec7b0f8e;p=deliverable%2Fbabeltrace.git Fix: wrong variable checked for NULL after allocation 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 --- 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; }