- fix: memory leak (85522).
authorjbj <devnull@localhost>
Thu, 6 Mar 2003 22:50:04 +0000 (22:50 +0000)
committerjbj <devnull@localhost>
Thu, 6 Mar 2003 22:50:04 +0000 (22:50 +0000)
CVS patchset: 6656
CVS date: 2003/03/06 22:50:04

12 files changed:
CHANGES
build/Makefile.am
lib/Makefile.am
lib/package.c
lib/psm.c
lib/rpmts.c
rpm.spec.in
rpmdb/Makefile.am
rpmio/Makefile.am
scripts/macros.perl [new file with mode: 0644]
scripts/macros.php [new file with mode: 0644]
scripts/macros.python [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index c9a6fe0..322bc4c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
        - 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.
index 00204a2..51fe855 100644 (file)
@@ -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 = \
index 4ab3fad..0ec8d04 100644 (file)
@@ -24,6 +24,8 @@ noinst_HEADERS = \
 mylibs = librpm.la
 LIBS =
 
+LDFLAGS = -L$(DESTDIR)$(usrlibdir)
+
 usrlibdir = $(libdir)@MARK64@
 usrlib_LTLIBRARIES = librpm.la
 librpm_la_SOURCES = \
index e6f9121..ef9949d 100644 (file)
@@ -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;
 }
 
index 3cecfe3..0436934 100644 (file)
--- 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))
index e2809f3..13710a5 100644 (file)
@@ -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)
index 54c186f..297715f 100644 (file)
@@ -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
 
index 3cc0453..456ae79 100644 (file)
@@ -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 = \
index 20a7f3a..49355fb 100644 (file)
@@ -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 (file)
index 0000000..b147fbc
--- /dev/null
@@ -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 (file)
index 0000000..9781775
--- /dev/null
@@ -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 (file)
index 0000000..8975fef
--- /dev/null
@@ -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'):])"