Fix: wrong variable checked for NULL after allocation
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 Aug 2017 19:46:47 +0000 (15:46 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 Aug 2017 19:46:47 +0000 (15:46 -0400)
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 <jeremie.galarneau@efficios.com>
plugins/ctf/fs-sink/writer.c

index ae30a84b37504ea46594711221a22d48ab2d92df..fd2c1632df961b8b729874d17ba0d396d3d2e02c 100644 (file)
@@ -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;
        }
This page took 0.025658 seconds and 4 git commands to generate.