Eliminate a few dead NULL-assignment eliminations in rpmgraph
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 30 May 2011 08:00:31 +0000 (11:00 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 30 May 2011 08:00:31 +0000 (11:00 +0300)
- There are more but leaving the rest as a reminder to clean
  up rpmGraph() someday when bored enough...

tools/rpmgraph.c

index bbb9d29..082a9cd 100644 (file)
@@ -22,7 +22,6 @@ static rpmVSFlags vsflags = 0;
 static int
 rpmGraph(rpmts ts, struct rpmInstallArguments_s * ia, const char ** fileArgv)
 {
-    rpmps ps;
     char ** pkgURL = NULL;
     char * pkgState = NULL;
     const char ** fnp;
@@ -158,6 +157,7 @@ maybe_manifest:
     if (numFailed > 0) goto exit;
 
     if (!noDeps) {
+       rpmps ps;
        rc = rpmtsCheck(ts);
        if (rc) {
            numFailed += numPkgs;
@@ -169,7 +169,7 @@ maybe_manifest:
            rpmpsPrint(NULL, ps);
            numFailed += numPkgs;
        }
-       ps = rpmpsFree(ps);
+       rpmpsFree(ps);
     }
 
     rc = rpmtsOrder(ts);
@@ -196,7 +196,7 @@ maybe_manifest:
                fprintf(stdout, "  { rank=max ; \"%s\" }\n", rpmteN(p));
            }
        }
-       pi = rpmtsiFree(pi);
+       rpmtsiFree(pi);
 
        fprintf(stdout, "}\n");
     }
@@ -250,9 +250,9 @@ main(int argc, char *argv[])
 
     ec = rpmGraph(ts, ia, poptGetArgs(optCon));
 
-    ts = rpmtsFree(ts);
+    rpmtsFree(ts);
 
-    optCon = rpmcliFini(optCon);
+    rpmcliFini(optCon);
 
     return ec;
 }