diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-05-28 09:47:58 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-05-28 09:47:58 +0300 |
commit | bafde44e2d034f75189d3926475170b4ca854024 (patch) | |
tree | bffd3fc411f51b0d0257cb3687afe126224b6ab8 /build | |
parent | de94517558501c12fafb090e9a087f238351a8c9 (diff) | |
download | librpm-tizen-bafde44e2d034f75189d3926475170b4ca854024.tar.gz librpm-tizen-bafde44e2d034f75189d3926475170b4ca854024.tar.bz2 librpm-tizen-bafde44e2d034f75189d3926475170b4ca854024.zip |
Clean up file records freeing a bit
- All the necessary data is in FileRecords struct so we only
need to pass that. Dont bother NULLing everything as these
are not passed around in a way where it would matter.
Diffstat (limited to 'build')
-rw-r--r-- | build/files.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/build/files.c b/build/files.c index 776a7f9c8..5cf993eee 100644 --- a/build/files.c +++ b/build/files.c @@ -1241,18 +1241,15 @@ static void genCpioListAndHeader(FileList fl, } } -/** - */ -static FileListRec freeFileList(FileListRec fileList, - int count) +static FileRecords FileRecordsFree(FileRecords files) { - while (count--) { - fileList[count].diskPath = _free(fileList[count].diskPath); - fileList[count].cpioPath = _free(fileList[count].cpioPath); - fileList[count].langs = _free(fileList[count].langs); - fileList[count].caps = _free(fileList[count].caps); + for (int i = 0; i < files->used; i++) { + free(files->recs[i].diskPath); + free(files->recs[i].cpioPath); + free(files->recs[i].langs); + free(files->recs[i].caps); } - free(fileList); + free(files->recs); return NULL; } @@ -1907,7 +1904,7 @@ exit: FileEntryFree(&fl.cur); FileEntryFree(&fl.def); - fl.files.recs = freeFileList(fl.files.recs, fl.files.used); + FileRecordsFree(&fl.files); argvFree(fl.docDirs); specialDirFree(specialDoc); return fl.processingFailed ? RPMRC_FAIL : RPMRC_OK; @@ -2041,7 +2038,7 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) } } - fl.files.recs = freeFileList(fl.files.recs, fl.files.used); + FileRecordsFree(&fl.files); freeAttrRec(&fl.def.ar); return fl.processingFailed ? RPMRC_FAIL : RPMRC_OK; } |