From: jbj Date: Thu, 6 Mar 2003 22:50:04 +0000 (+0000) Subject: - fix: memory leak (85522). X-Git-Tag: rpm-4.4-release~680 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51e7f7a5e9f5e5c762e049a97309e32928dd5bcc;p=platform%2Fupstream%2Frpm.git - fix: memory leak (85522). CVS patchset: 6656 CVS date: 2003/03/06 22:50:04 --- diff --git a/CHANGES b/CHANGES index c9a6fe0..322bc4c 100644 --- a/CHANGES +++ b/CHANGES @@ -125,6 +125,7 @@ - add file(1) as /usr/lib/rpm/rpmfile. - enable transaction coloring for s390x/ppc64. - file: check size read from elf header (#85297). + - fix: memory leak (85522). 4.0.4 -> 4.1: - loosely wire beecrypt library into rpm. diff --git a/build/Makefile.am b/build/Makefile.am index 00204a2..51fe855 100644 --- a/build/Makefile.am +++ b/build/Makefile.am @@ -19,6 +19,8 @@ pkgincdir = $(pkgincludedir) pkginc_HEADERS = rpmbuild.h rpmfc.h rpmfile.h rpmspec.h noinst_HEADERS = buildio.h +LDFLAGS = -L$(DESTDIR)$(usrlibdir) + usrlibdir = $(libdir)@MARK64@ usrlib_LTLIBRARIES = librpmbuild.la librpmbuild_la_SOURCES = \ diff --git a/lib/Makefile.am b/lib/Makefile.am index 4ab3fad..0ec8d04 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -24,6 +24,8 @@ noinst_HEADERS = \ mylibs = librpm.la LIBS = +LDFLAGS = -L$(DESTDIR)$(usrlibdir) + usrlibdir = $(libdir)@MARK64@ usrlib_LTLIBRARIES = librpm.la librpm_la_SOURCES = \ diff --git a/lib/package.c b/lib/package.c index e6f9121..ef9949d 100644 --- a/lib/package.c +++ b/lib/package.c @@ -535,7 +535,6 @@ verifyinfo_exit: _("only V3 signatures can be verified, skipping V%u signature\n"), dig->signature.version); rpmtsCleanDig(ts); - sig = _free(sig); goto verifyinfo_exit; } @@ -576,7 +575,6 @@ verifyinfo_exit: _("only V3 signatures can be verified, skipping V%u signature\n"), dig->signature.version); rpmtsCleanDig(ts); - sig = _free(sig); goto verifyinfo_exit; } /*@fallthrough@*/ @@ -611,6 +609,7 @@ verifyinfo_exit: break; default: + sig = _free(sig); break; } @@ -625,6 +624,8 @@ verifyinfo_exit: /*@=boundswrite@*/ rpmtsCleanDig(ts); + if (info->tag == RPMTAG_SHA1HEADER) + sig = _free(sig); return rc; } diff --git a/lib/psm.c b/lib/psm.c index 3cecfe3..0436934 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -1571,13 +1571,13 @@ psm->te->h = headerLink(fi->h); psm->countCorrection = -1; if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOTRIGGERUN)) { - /* Run triggers in other package(s) this package sets off. */ - rc = rpmpsmStage(psm, PSM_TRIGGERS); - if (rc) break; - /* Run triggers in this package other package(s) set off. */ rc = rpmpsmStage(psm, PSM_IMMED_TRIGGERS); if (rc) break; + + /* Run triggers in other package(s) this package sets off. */ + rc = rpmpsmStage(psm, PSM_TRIGGERS); + if (rc) break; } if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPREUN)) diff --git a/lib/rpmts.c b/lib/rpmts.c index e2809f3..13710a5 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -832,10 +832,10 @@ int_32 rpmtsSigtag(const rpmts ts) int_32 rpmtsSigtype(const rpmts ts) { - int_32 sigtag = 0; + int_32 sigtype = 0; if (ts != NULL) - sigtag = ts->sigtag; - return sigtag; + sigtype = ts->sigtype; + return sigtype; } const void * rpmtsSig(const rpmts ts) diff --git a/rpm.spec.in b/rpm.spec.in index 54c186f..297715f 100644 --- a/rpm.spec.in +++ b/rpm.spec.in @@ -117,7 +117,7 @@ shell-like rules. %build # XXX rpm needs functioning nptl for configure tests -unset LD_ASSUME_KERNEL +unset LD_ASSUME_KERNEL || : %if %{with_python_subpackage} WITH_PYTHON="--with-python=%{with_python_version}" @@ -144,7 +144,7 @@ make %install # XXX rpm needs functioning nptl for configure tests -unset LD_ASSUME_KERNEL +unset LD_ASSUME_KERNEL || : rm -rf $RPM_BUILD_ROOT diff --git a/rpmdb/Makefile.am b/rpmdb/Makefile.am index 3cc0453..456ae79 100644 --- a/rpmdb/Makefile.am +++ b/rpmdb/Makefile.am @@ -38,6 +38,8 @@ LIBS = DB3LOBJS = $(shell cat $(top_builddir)/$(WITH_DB_SUBDIR)/db3lobjs) +LDFLAGS = -L$(DESTDIR)$(usrlibdir) + usrlibdir = $(libdir)@MARK64@ usrlib_LTLIBRARIES = librpmdb.la librpmdb_la_SOURCES = \ diff --git a/rpmio/Makefile.am b/rpmio/Makefile.am index 20a7f3a..49355fb 100644 --- a/rpmio/Makefile.am +++ b/rpmio/Makefile.am @@ -22,6 +22,8 @@ noinst_HEADERS = rpmio_internal.h BEECRYPTLOBJS = $(shell cat $(top_builddir)/beecrypt/listobjs) +LDFLAGS = -L$(DESTDIR)$(usrlibdir) + usrlibdir = $(libdir)@MARK64@ usrlib_LTLIBRARIES = librpmio.la librpmio_la_SOURCES = \ diff --git a/scripts/macros.perl b/scripts/macros.perl new file mode 100644 index 0000000..b147fbc --- /dev/null +++ b/scripts/macros.perl @@ -0,0 +1,12 @@ +# Perl specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %include /usr/lib/rpm/macros.perl + +%define __find_requires /usr/lib/rpm/find-perl-requires +%define __find_provides /usr/lib/rpm/find-perl-provides + +%define perl_sitelib %(eval "`perl -V:installsitelib`"; echo $installsitelib) +%define perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch) +%define perl_archlib %(eval "`perl -V:installarchlib`"; echo $installarchlib) +%define perl_privlib %(eval "`perl -V:installprivlib`"; echo $installprivlib) + diff --git a/scripts/macros.php b/scripts/macros.php new file mode 100644 index 0000000..9781775 --- /dev/null +++ b/scripts/macros.php @@ -0,0 +1,9 @@ +# Perl specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %include /usr/lib/rpm/macros.php + +%define __find_requires /usr/lib/rpm/find-php-requires +%define __find_provides /usr/lib/rpm/find-php-provides + +%define php_pear_dir %{_datadir}/pear + diff --git a/scripts/macros.python b/scripts/macros.python new file mode 100644 index 0000000..8975fef --- /dev/null +++ b/scripts/macros.python @@ -0,0 +1,18 @@ +# Python specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %include /usr/lib/rpm/macros.python + +# python main version +%define py_ver %(echo `python -c "import sys; print sys.version[:3]"`) + +# directories +%define py_prefix %(echo `python -c "import sys; print sys.prefix"`) +%define py_libdir %{py_prefix}/lib/python%{py_ver} +%define py_incdir /usr/include/python%{py_ver} +%define py_sitedir %{py_libdir}/site-packages +%define py_dyndir %{py_libdir}/lib-dynload + +# pure python modules compilation +%define py_comp python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])" + +%define py_ocomp python -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"