Cleanup: identical code for different branches
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Jul 2017 17:18:01 +0000 (13:18 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 Aug 2017 19:13:25 +0000 (15:13 -0400)
Found by Coverity:

CID 1376174 (#1 of 1): Identical code for different branches
(IDENTICAL_BRANCHES)identical_branches: The same code is executed when
the condition !trimmer is true or false, because the code in the if-then
branch and after the if statement is identical. Should the if statement
be removed?

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/utils/trimmer/trimmer.c

index d3460fbb83e299380557e88530d5ea7e6b32f2bc..352b0cffa3405d2cdab76985548c00e249cb9f33 100644 (file)
@@ -53,14 +53,7 @@ void destroy_trimmer_data(struct trimmer *trimmer)
 static
 struct trimmer *create_trimmer_data(void)
 {
-       struct trimmer *trimmer;
-
-       trimmer = g_new0(struct trimmer, 1);
-       if (!trimmer) {
-               goto end;
-       }
-end:
-       return trimmer;
+       return g_new0(struct trimmer, 1);
 }
 
 void finalize_trimmer(struct bt_private_component *component)
This page took 0.025277 seconds and 4 git commands to generate.