diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-05-28 22:30:41 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-05-29 11:50:54 +0300 |
commit | b1597da353522a0ba7581766f31d8fbd5272ac66 (patch) | |
tree | 2dd9cb43efc714757f1e153ed4a81519c796825d /lib | |
parent | 7c036b9ca33c67fa8530d886e2072e264fcba6df (diff) | |
download | librpm-tizen-b1597da353522a0ba7581766f31d8fbd5272ac66.tar.gz librpm-tizen-b1597da353522a0ba7581766f31d8fbd5272ac66.tar.bz2 librpm-tizen-b1597da353522a0ba7581766f31d8fbd5272ac66.zip |
Eliminate dead NULL-assignments at scope-end in librpm, part VI
- Remove NULL-assignments of local variables at the end of scope
in "cli-level" code
Diffstat (limited to 'lib')
-rw-r--r-- | lib/poptALL.c | 4 | ||||
-rw-r--r-- | lib/query.c | 10 | ||||
-rw-r--r-- | lib/rpmgi.c | 2 | ||||
-rw-r--r-- | lib/rpminstall.c | 13 | ||||
-rw-r--r-- | lib/verify.c | 4 |
5 files changed, 16 insertions, 17 deletions
diff --git a/lib/poptALL.c b/lib/poptALL.c index 9f39d4f1c..1091c46e7 100644 --- a/lib/poptALL.c +++ b/lib/poptALL.c @@ -104,14 +104,14 @@ static void rpmcliAllArgCallback( poptContext con, rpmcliConfigured(); (void) rpmDefineMacro(NULL, t, RMIL_CMDLINE); (void) rpmDefineMacro(rpmCLIMacroContext, t, RMIL_CMDLINE); - s = _free(s); + free(s); break; } case 'E': rpmcliConfigured(); { char *val = rpmExpand(arg, NULL); fprintf(stdout, "%s\n", val); - val = _free(val); + free(val); } break; case POPT_DBPATH: diff --git a/lib/query.c b/lib/query.c index dd9c76fee..7df233aa4 100644 --- a/lib/query.c +++ b/lib/query.c @@ -233,7 +233,7 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h) rc = 0; exit: - fi = rpmfiFree(fi); + rpmfiFree(fi); return rc; } @@ -407,7 +407,7 @@ static rpmdbMatchIterator initQueryIterator(QVA_t qva, rpmts ts, const char * ar } else if (*arg != '/') { char *curDir = rpmGetCwd(); fn = (char *) rpmGetPath(curDir, "/", arg, NULL); - curDir = _free(curDir); + free(curDir); } else fn = xstrdup(arg); (void) rpmCleanPath(fn); @@ -425,7 +425,7 @@ static rpmdbMatchIterator initQueryIterator(QVA_t qva, rpmts ts, const char * ar _("file %s is not owned by any package\n"), fn); } - fn = _free(fn); + free(fn); } break; case RPMQV_DBOFFSET: @@ -508,13 +508,13 @@ int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_const_t argv) case RPMQV_ALL: { rpmdbMatchIterator mi = initFilterIterator(ts, argv); ec = rpmcliShowMatches(qva, ts, mi); - mi = rpmdbFreeIterator(mi); + rpmdbFreeIterator(mi); break; } case RPMQV_RPM: { rpmgi gi = rpmgiNew(ts, giFlags, argv); ec = rpmgiShowMatches(qva, ts, gi); - gi = rpmgiFree(gi); + rpmgiFree(gi); break; } case RPMQV_SPECRPMS: diff --git a/lib/rpmgi.c b/lib/rpmgi.c index afc1c4916..1b2de8ad5 100644 --- a/lib/rpmgi.c +++ b/lib/rpmgi.c @@ -50,7 +50,7 @@ static FD_t rpmgiOpen(const char * path, const char * fmode) if (fd != NULL) (void) Fclose(fd); fd = NULL; } - fn = _free(fn); + free(fn); return fd; } diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 7569bbf77..2cacacf33 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -99,7 +99,6 @@ void * rpmShowProgress(const void * arg, void * data) { Header h = (Header) arg; - char * s; int flags = (int) ((long)data); void * rc = NULL; const char * filename = (const char *)key; @@ -138,18 +137,18 @@ void * rpmShowProgress(const void * arg, break; /* @todo Remove headerFormat() on a progress callback. */ if (flags & INSTALL_HASH) { - s = headerFormat(h, "%{NAME}", NULL); + char *s = headerFormat(h, "%{NAME}", NULL); if (isatty (STDOUT_FILENO)) fprintf(stdout, "%4d:%-23.23s", rpmcliProgressCurrent + 1, s); else fprintf(stdout, "%-28.28s", s); (void) fflush(stdout); - s = _free(s); + free(s); } else { - s = headerFormat(h, "%{NAME}-%{VERSION}-%{RELEASE}", NULL); + char *s = headerFormat(h, "%{NAME}-%{VERSION}-%{RELEASE}", NULL); fprintf(stdout, "%s\n", s); (void) fflush(stdout); - s = _free(s); + free(s); } break; @@ -363,7 +362,7 @@ static int checkFreshenStatus(rpmts ts, Header h) break; } - mi = rpmdbFreeIterator(mi); + rpmdbFreeIterator(mi); return (oldH != NULL); } @@ -668,7 +667,7 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv) free(nevra); } } - mi = rpmdbFreeIterator(mi); + rpmdbFreeIterator(mi); } } free(qfmt); diff --git a/lib/verify.c b/lib/verify.c index 28a031139..30fddfef1 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -420,9 +420,9 @@ static int verifyDependencies(rpmts ts, Header h) rpmlog(RPMLOG_NOTICE, "\t%s\n", ps); free(ps); } - psi = rpmpsFreeIterator(psi); + rpmpsFreeIterator(psi); } - ps = rpmpsFree(ps); + rpmpsFree(ps); rpmtsEmpty(ts); return rc; |