diff options
author | Michael Schroeder <mls@suse.de> | 2014-01-08 14:43:10 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2014-01-08 14:43:10 +0100 |
commit | 178e160000d17cd9a7bebb160bb0b031092a6887 (patch) | |
tree | 07c12afce0fe0be085402010a5cdd02afa0650a3 | |
parent | 84957715aacbe8405e3cb367fe763220d5ba6b42 (diff) | |
download | libsolv-178e160000d17cd9a7bebb160bb0b031092a6887.tar.gz libsolv-178e160000d17cd9a7bebb160bb0b031092a6887.tar.bz2 libsolv-178e160000d17cd9a7bebb160bb0b031092a6887.zip |
three other changes to make cppcheck happier
-rw-r--r-- | ext/repo_rpmdb.c | 3 | ||||
-rw-r--r-- | src/selection.c | 3 | ||||
-rw-r--r-- | 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; |