Jeff Johnson's memleak patches
authormarc <devnull@localhost>
Thu, 9 Apr 1998 20:20:17 +0000 (20:20 +0000)
committermarc <devnull@localhost>
Thu, 9 Apr 1998 20:20:17 +0000 (20:20 +0000)
CVS patchset: 2085
CVS date: 1998/04/09 20:20:17

CHANGES
build/files.c
build/pack.c
build/parsePrep.c
build/reqprov.c
lib/uninstall.c

diff --git a/CHANGES b/CHANGES
index 329607a..4d18825 100644 (file)
--- 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
index ba6438e..a81b469 100644 (file)
@@ -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),
index e1e7f8a..8f632c6 100644 (file)
@@ -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;
index ba9a26a..305e52d 100644 (file)
@@ -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;
 }
index b37107d..2ea609f 100644 (file)
@@ -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 ***/
 
index 3a110f8..99a9c6d 100644 (file)
@@ -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,