From 484c325f037a36ccd8a69859f077ff1efe5f8da7 Mon Sep 17 00:00:00 2001 From: marc Date: Thu, 9 Apr 1998 20:20:17 +0000 Subject: [PATCH] Jeff Johnson's memleak patches CVS patchset: 2085 CVS date: 1998/04/09 20:20:17 --- CHANGES | 1 + build/files.c | 6 +++--- build/pack.c | 1 + build/parsePrep.c | 7 +++++-- build/reqprov.c | 4 ++-- lib/uninstall.c | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 329607a..4d18825 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ - remove icons with --rmsource - do dependecy generation on -bl - check files on all packages on -bl + - integrate Jeff Johnson's memleak patches 2.4.107 -> 2.4.108: - make --clean work with no %setup diff --git a/build/files.c b/build/files.c index ba6438e..a81b469 100644 --- a/build/files.c +++ b/build/files.c @@ -148,7 +148,7 @@ int processSourceFiles(Spec spec) /* do not copy */ break; } - if (type == RPM_STRING_ARRAY_TYPE) { + if (type == RPM_STRING_ARRAY_TYPE || type == RPM_I18NSTRING_TYPE) { FREE(ptr); } } @@ -243,7 +243,7 @@ int processSourceFiles(Spec spec) x++; } fl.fileListRecsUsed = x; - FREE(files); + freeSplitString(files); if (! fl.processingFailed) { genCpioListAndHeader(&fl, &(spec->sourceCpioList), @@ -450,7 +450,7 @@ static int processPackageFiles(Spec spec, Package pkg, int installSpecialDoc) FREE(specialDoc); } - FREE(files); + freeSplitString(files); if (! fl.processingFailed) { genCpioListAndHeader(&fl, &(pkg->cpioList), &(pkg->cpioCount), diff --git a/build/pack.c b/build/pack.c index e1e7f8a..8f632c6 100644 --- a/build/pack.c +++ b/build/pack.c @@ -215,6 +215,7 @@ static int writeRPM(Header header, char *fileName, int type, sprintf(buf, "%s-%s-%s", name, version, release); rpmGetArchInfo(NULL, &arch); rpmGetOsInfo(NULL, &os); + memset(&lead, 0, sizeof(lead)); lead.major = RPM_MAJOR_NUMBER; lead.minor = 0; lead.type = type; diff --git a/build/parsePrep.c b/build/parsePrep.c index ba9a26a..305e52d 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -55,13 +55,13 @@ int parsePrep(Spec spec) spec->prep = newStringBuf(); - buf = newStringBuf(); - /* There are no options to %prep */ if (readLine(spec, STRIP_NOTHING) > 0) { return PART_NONE; } + buf = newStringBuf(); + while (! (nextPart = isPart(spec->line))) { /* Need to expand the macros inline. That way we */ /* can give good line number information on error. */ @@ -85,11 +85,14 @@ int parsePrep(Spec spec) } if (res) { freeSplitString(saveLines); + freeStringBuf(buf); return res; } lines++; } + freeSplitString(saveLines); + freeStringBuf(buf); return nextPart; } diff --git a/build/reqprov.c b/build/reqprov.c index b37107d..2ea609f 100644 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -142,7 +142,7 @@ int generateAutoReqProv(Spec spec, Package pkg, } f++; } - FREE(fsave); + freeSplitString(fsave); /*** Do Requires ***/ @@ -167,7 +167,7 @@ int generateAutoReqProv(Spec spec, Package pkg, } f++; } - FREE(fsave); + freeSplitString(fsave); /*** Clean Up ***/ diff --git a/lib/uninstall.c b/lib/uninstall.c index 3a110f8..99a9c6d 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -303,7 +303,7 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) { } } - free(netsharedPaths); + freeSplitString(netsharedPaths); } handleSharedFiles(db, offset, fileList, fileMd5List, fileCount, -- 2.7.4