diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-05-28 11:06:46 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-05-28 11:06:46 +0300 |
commit | d8334d2e3f8b96dd279cceba69bb9ca0d2ba7d8b (patch) | |
tree | 6f469110197582bee1751e992dc1f32329abd4a6 /build | |
parent | 975489fa26746b26fc2701e9e33373c4e603109a (diff) | |
download | rpm-d8334d2e3f8b96dd279cceba69bb9ca0d2ba7d8b.tar.gz rpm-d8334d2e3f8b96dd279cceba69bb9ca0d2ba7d8b.tar.bz2 rpm-d8334d2e3f8b96dd279cceba69bb9ca0d2ba7d8b.zip |
Move file list freeing to helper function
Diffstat (limited to 'build')
-rw-r--r-- | build/files.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/build/files.c b/build/files.c index cec098cc7..513c3d5d2 100644 --- a/build/files.c +++ b/build/files.c @@ -1252,6 +1252,15 @@ static FileRecords FileRecordsFree(FileRecords files) return NULL; } +static void FileListFree(FileList fl) +{ + FileEntryFree(&(fl->cur)); + FileEntryFree(&(fl->def)); + FileRecordsFree(&(fl->files)); + free(fl->buildRoot); + argvFree(fl->docDirs); +} + /* forward ref */ static rpmRC recurseDir(FileList fl, const char * diskPath); @@ -1898,13 +1907,7 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, fl.processingFailed = 1; exit: - fl.buildRoot = _free(fl.buildRoot); - - FileEntryFree(&fl.cur); - FileEntryFree(&fl.def); - - FileRecordsFree(&fl.files); - argvFree(fl.docDirs); + FileListFree(&fl); specialDirFree(specialDoc); return fl.processingFailed ? RPMRC_FAIL : RPMRC_OK; } @@ -2037,8 +2040,7 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) } } - FileRecordsFree(&fl.files); - freeAttrRec(&fl.def.ar); + FileListFree(&fl); return fl.processingFailed ? RPMRC_FAIL : RPMRC_OK; } |