63 lines
2.1 KiB
Diff
63 lines
2.1 KiB
Diff
From 125f04cb6d742fb13f691cfbff54437014a399bd Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
|
|
Date: Mon, 20 May 2019 14:25:34 +0200
|
|
Subject: [PATCH 2/3] export: Remove unused variable
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
err is declared, set to NULL, but never used in
|
|
osinfo_db_export_create().
|
|
|
|
Error: DEADCODE (CWE-561):
|
|
osinfo-db-tools-1.5.0/tools/osinfo-db-export.c:410: assignment:
|
|
Assigning: "err" = "NULL".
|
|
osinfo-db-tools-1.5.0/tools/osinfo-db-export.c:448: null: At condition
|
|
"err", the value of "err" must be "NULL".
|
|
osinfo-db-tools-1.5.0/tools/osinfo-db-export.c:448: dead_error_condition:
|
|
The condition "err" cannot be true.
|
|
osinfo-db-tools-1.5.0/tools/osinfo-db-export.c:449: dead_error_line:
|
|
Execution cannot reach this statement: "g_error_free(err);".
|
|
osinfo-db-tools-1.5.0/tools/osinfo-db-export.c:449: effectively_constant:
|
|
Local variable "err" is assigned only once, to a constant value, making
|
|
it effectively constant throughout its scope. If this is not the intent,
|
|
examine the logic to see if there is a missing assigment that would make
|
|
"err" not remain constant.
|
|
# 447| archive_write_free(arc);
|
|
# 448| if (err)
|
|
# 449|-> g_error_free(err);
|
|
# 450| return ret;
|
|
# 451| }
|
|
|
|
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
|
|
Reviewed-by: Cole Robinson <crobinso@redhat.com>
|
|
(cherry picked from commit 2d747c637c78c000002f97880436d94cc08a6b5c)
|
|
---
|
|
tools/osinfo-db-export.c | 3 ---
|
|
1 file changed, 3 deletions(-)
|
|
|
|
diff --git a/tools/osinfo-db-export.c b/tools/osinfo-db-export.c
|
|
index 3137e1d..eef6688 100644
|
|
--- a/tools/osinfo-db-export.c
|
|
+++ b/tools/osinfo-db-export.c
|
|
@@ -407,7 +407,6 @@ static int osinfo_db_export_create(const gchar *prefix,
|
|
struct archive *arc;
|
|
int ret = -1;
|
|
int r;
|
|
- GError *err = NULL;
|
|
|
|
arc = archive_write_new();
|
|
|
|
@@ -445,8 +444,6 @@ static int osinfo_db_export_create(const gchar *prefix,
|
|
ret = 0;
|
|
cleanup:
|
|
archive_write_free(arc);
|
|
- if (err)
|
|
- g_error_free(err);
|
|
return ret;
|
|
}
|
|
|
|
--
|
|
2.21.0
|
|
|