From a953e39aa513bb10faa23a03a7befa1de29f54e7 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 19 Mar 2008 21:18:11 +0000 Subject: [PATCH] - fix memory leak - fix stupid typo --- tools/common_write.c | 4 ++-- tools/repo_write.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/common_write.c b/tools/common_write.c index a16b1b1..ced7928 100644 --- a/tools/common_write.c +++ b/tools/common_write.c @@ -248,7 +248,7 @@ tool_write(Repo *repo, const char *basename, const char *attrname) } kd.languages = languages; kd.nlanguages = nlanguages; - repo_write(repo, fp, keyfilter_other, &kd, fileinfos, nfileinfos); + repo_write(repo, fp, keyfilter_other, &kd, nfileinfos ? fileinfos : 0, nfileinfos); fclose(fp); for (i = 0; i < nlanguages; i++) free(languages[i]); @@ -272,7 +272,7 @@ tool_write(Repo *repo, const char *basename, const char *attrname) fclose(fp); nfileinfos++; } - repo_write(repo, stdout, keyfilter_solv, 0, fileinfos, nfileinfos); + repo_write(repo, stdout, keyfilter_solv, 0, nfileinfos ? fileinfos : 0, nfileinfos); for (i = 0; i < nfileinfos; i++) { sat_free(fileinfos[i].addedfileprovides); diff --git a/tools/repo_write.c b/tools/repo_write.c index 0bd6118..b8249dd 100644 --- a/tools/repo_write.c +++ b/tools/repo_write.c @@ -1241,7 +1241,7 @@ for (i = 1; i < cbdata.nmykeys; i++) *sp++ = cbdata.keymap[REPODATA_INFO]; *sp++ = cbdata.keymap[REPODATA_ADDEDFILEPROVIDES]; for (j = 0; fileinfo[i].addedfileprovides[j]; j++) - j++; + ; cbdata.mykeys[cbdata.keymap[REPODATA_ADDEDFILEPROVIDES]].size += j + 1; } else -- 2.34.1