From: ewt Date: Fri, 30 Aug 1996 19:17:33 +0000 (+0000) Subject: 1) plugged some memory leaks X-Git-Tag: rpm-4.4-release~4737 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6aad60201615b3802df88ea4e434f0aaa3449540;p=platform%2Fupstream%2Frpm.git 1) plugged some memory leaks 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 --- diff --git a/lib/install.c b/lib/install.c index c094197..6a8c805 100644 --- a/lib/install.c +++ b/lib/install.c @@ -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; }