int stopInstall = 0;
size_t nb;
int notifyFlags = interfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 );
- rpmProblemSet probs, finalProbs;
int dbIsOpen = 0;
const char ** sourcePackages;
}
if (numBinaryPackages && !(interfaceFlags & INSTALL_NOORDER)) {
- if (rpmdepOrder(rpmdep, (void ***) &packages)) {
+ if (rpmdepOrder(rpmdep, NULL)) {
numFailed = numPackages;
stopInstall = 1;
}
}
if (numBinaryPackages && !stopInstall) {
+ rpmProblemSet probs = NULL;
+;
rpmMessage(RPMMESS_DEBUG, _("installing binary packages\n"));
rc = rpmRunTransactions(rpmdep, showProgress, (void *) notifyFlags,
NULL, &probs, transFlags);
if (rc < 0) {
numFailed += numPackages;
} else if (rc) {
+ rpmProblemSet finalProbs = NULL;
rpmProblemSetFilter(probs, probFilter);
rc = rpmRunTransactions(rpmdep, showProgress, (void *) notifyFlags,
probs, &finalProbs, transFlags);
rpmProblemSetFree(probs);
+ probs = NULL;
if (rc < 0) {
numFailed += numBinaryPackages;
} else if (rc) {
numFailed += rc;
- for (i = 0; i < finalProbs->numProblems; i++)
- if (!finalProbs->probs[i].ignoreProblem)
- rpmMessage(RPMMESS_ERROR, "%s\n",
- rpmProblemString(finalProbs->probs[i]));
-
- rpmProblemSetFree(finalProbs);
+ for (i = 0; i < finalProbs->numProblems; i++) {
+ if (!finalProbs->probs[i].ignoreProblem) {
+ char *msg = rpmProblemString(finalProbs->probs[i]);
+ rpmMessage(RPMMESS_ERROR, "%s\n", msg);
+ free(msg);
+ }
+ }
}
+ if (finalProbs) rpmProblemSetFree(finalProbs);
}
+ if (probs) rpmProblemSetFree(probs);
}
if (numBinaryPackages) rpmtransFree(rpmdep);
continue;
}
+/* XXX FIXME: There is a memory leak here ... */
fi->actions = calloc(sizeof(*fi->actions), fi->fc);
fi->h = hdrs[alp - al->list] = relocateFileList(alp, probs, alp->h,
fi->actions);
headerGetEntryMinMemory(fi->h, RPMTAG_FILESTATES, NULL,
(void *) &fi->fstates, NULL);
+/* XXX FIXME: ... or there is a memory leak here ... */
/* Note that as FA_UNKNOWN = 0, this does the right thing */
+ if (fi->actions) {
+ free(fi->actions);
+ fi->actions = NULL;
+ }
fi->actions = calloc(sizeof(*fi->actions), fi->fc);
fi->fps = alloca(fi->fc * sizeof(*fi->fps));
}
shared->otherFileNum = matches[i].recs[j].fileNumber;
shared++;
}
+ dbiFreeIndexRecord(matches[i]);
}
shared->otherPkg = -1;
free(matches);
if (fi->fc) {
headerFree(hdrs[alp - al->list]);
free(fi->actions);
+ fi->actions = NULL;
}
}
headerFree(hdrs[alp - al->list]);
- if (fi->fc)
+ if (fi->fc) {
free(fi->actions);
+ fi->actions = NULL;
+ }
if (!alp->fd && fd)
notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE, 0, 0, alp->key,
NOTIFY((NULL, RPMCALLBACK_UNINST_STOP, 0, ts->numRemovedPackages,
NULL, notifyData));
+/* XXX FIXME: ... or possibly there is a memory leak here. */
+ if (fi->actions) {
+ free(fi->actions);
+ fi->actions = NULL;
+ }
+/* XXX FIXME: This smells like a memory leak. */
+ if (fi->replaced) {
+ free(fi->replaced);
+ fi->replaced = NULL;
+ }
+
if (ourrc)
return -1;
else