From: Michael Schroeder Date: Wed, 8 Jan 2014 13:43:10 +0000 (+0100) Subject: three other changes to make cppcheck happier X-Git-Tag: 0.6.4~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=178e160000d17cd9a7bebb160bb0b031092a6887;p=thirdparty%2Flibsolv.git three other changes to make cppcheck happier --- diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 281a5557..613b6e89 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 e597a319..badb41f6 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 de670793..afec8c5a 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;