From 178e160000d17cd9a7bebb160bb0b031092a6887 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 8 Jan 2014 14:43:10 +0100 Subject: [PATCH] three other changes to make cppcheck happier --- ext/repo_rpmdb.c | 3 +-- src/selection.c | 3 +-- src/solverdebug.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 281a555..613b6e8 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -2122,8 +2122,7 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) repodata_set_bin_checksum(data, s - pool->solvables, SOLVABLE_CHECKSUM, chksumtype, solv_chksum_get(chksumh, 0)); chksumh = solv_chksum_free(chksumh, 0); } - if (rpmhead) - solv_free(rpmhead); + solv_free(rpmhead); if (!(flags & REPO_NO_INTERNALIZE)) repodata_internalize(data); return s - pool->solvables; diff --git a/src/selection.c b/src/selection.c index e597a31..badb41f 100644 --- a/src/selection.c +++ b/src/selection.c @@ -840,12 +840,11 @@ int selection_make(Pool *pool, Queue *selection, const char *name, int flags) { int ret = 0; - const char *r; queue_empty(selection); if (*name == '/' && (flags & SELECTION_FILELIST)) ret = selection_filelist(pool, selection, name, flags); - if (!ret && (flags & SELECTION_REL) != 0 && (r = strpbrk(name, "<=>")) != 0) + if (!ret && (flags & SELECTION_REL) != 0 && strpbrk(name, "<=>") != 0) ret = selection_rel(pool, selection, name, flags); if (!ret) ret = selection_depglob_arch(pool, selection, name, flags); diff --git a/src/solverdebug.c b/src/solverdebug.c index de67079..afec8c5 100644 --- a/src/solverdebug.c +++ b/src/solverdebug.c @@ -75,7 +75,7 @@ solver_printrule(Solver *solv, int type, Rule *r) POOL_DEBUG(type, "Rule #%d:", (int)(r - solv->rules)); else POOL_DEBUG(type, "Rule:"); /* r is any rule */ - if (r && r->d < 0) + if (r->d < 0) POOL_DEBUG(type, " (disabled)"); POOL_DEBUG(type, "\n"); d = r->d < 0 ? -r->d - 1 : r->d; -- 2.34.1