1) plugged some memory leaks
authorewt <devnull@localhost>
Fri, 30 Aug 1996 19:17:33 +0000 (19:17 +0000)
committerewt <devnull@localhost>
Fri, 30 Aug 1996 19:17:33 +0000 (19:17 +0000)
2) call _exit(), not exit() from subprocess to prevent stdio buffers from
   being flushed twice

CVS patchset: 998
CVS date: 1996/08/30 19:17:33

lib/install.c

index c094197..6a8c805 100644 (file)
@@ -391,6 +391,7 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd, char * location,
                    error(RPMERR_RENAME, "rename of %s to %s failed: %s\n",
                          prefixedFileList[i], newpath, strerror(errno));
                    if (replacedList) free(replacedList);
+                   free(newpath);
                    return 2;
                }
 
@@ -511,6 +512,8 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd, char * location,
        }
     }
 
+    freeHeader(h);
+
     return 0;
 }
 
@@ -638,7 +641,7 @@ static int installArchive(char * prefix, int fd, struct fileToInstall * files,
 
        execvp(args[0], args);
 
-       exit(-1);
+       _exit(-1);
     }
 
     close(p[0]);
@@ -819,7 +822,7 @@ static int setFileOwnerships(char * rootdir, char ** fileList,
     }
 
     if (doFork)
-       exit(0);
+       _exit(0);
 
     return 0;
 }