From 4fde0f03fe680be7f1086adf2f5357ea517c8caa Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 26 Jul 2017 13:18:01 -0400 Subject: [PATCH] Cleanup: identical code for different branches MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jérémie Galarneau --- plugins/utils/trimmer/trimmer.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/plugins/utils/trimmer/trimmer.c b/plugins/utils/trimmer/trimmer.c index d3460fbb..352b0cff 100644 --- a/plugins/utils/trimmer/trimmer.c +++ b/plugins/utils/trimmer/trimmer.c @@ -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) -- 2.34.1