- don't hang because of leftover query iterators (#246044)

This commit is contained in:
Panu Matilainen 2007-06-28 12:02:23 +00:00
parent 9148b403ac
commit 66621c977c
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,25 @@
changeset: 6070:7ca081cd83d8
tag: tip
user: Panu Matilainen <pmatilai@redhat.com>
date: Thu Jun 28 14:44:48 2007 +0300
summary: Remember to free up match iterators (rhbz#246044)
diff -r a468a8443652 -r 7ca081cd83d8 lib/query.c
--- a/lib/query.c Wed Jun 27 16:29:16 2007 +0300
+++ b/lib/query.c Thu Jun 28 14:44:48 2007 +0300
@@ -680,10 +680,12 @@ int rpmQueryVerify(QVA_t qva, rpmts ts,
case RPMQV_PACKAGE:
{
int matches = 0;
- qva->qva_mi = rpmtsInitIterator(ts, RPMDBI_LABEL, arg, 0);
- while (rpmdbNextIterator(qva->qva_mi) != NULL) {
+ rpmdbMatchIterator mi;
+ mi = rpmtsInitIterator(ts, RPMDBI_LABEL, arg, 0);
+ while (rpmdbNextIterator(mi) != NULL) {
matches++;
}
+ rpmdbFreeIterator(mi);
if (! matches) {
rpmError(RPMERR_QUERYINFO, _("package %s is not installed\n"), arg);
res = 1;

View File

@ -14,7 +14,7 @@ Summary: The RPM package management system
Name: rpm Name: rpm
Version: 4.4.2.1 Version: 4.4.2.1
%{expand: %%define rpm_version %{version}-rc1} %{expand: %%define rpm_version %{version}-rc1}
Release: 0.2.rc1 Release: 0.3.rc1
Group: System Environment/Base Group: System Environment/Base
Url: http://www.rpm.org/ Url: http://www.rpm.org/
Source: rpm-%{rpm_version}.tar.gz Source: rpm-%{rpm_version}.tar.gz
@ -25,6 +25,7 @@ Patch4: rpm-4.4.2-devel-autodep.patch
Patch5: rpm-4.4.2-rpmfc-skip.patch Patch5: rpm-4.4.2-rpmfc-skip.patch
Patch6: rpm-4.4.2-matchpathcon.patch Patch6: rpm-4.4.2-matchpathcon.patch
Patch7: rpm-4.4.2.1-rc1-poptver.patch Patch7: rpm-4.4.2.1-rc1-poptver.patch
Patch8: rpm-4.4.2.1-rc1-query-iterators.patch
License: GPL License: GPL
Requires(pre): shadow-utils Requires(pre): shadow-utils
Requires(postun): shadow-utils Requires(postun): shadow-utils
@ -135,6 +136,7 @@ shell-like rules.
%patch5 -p1 -b .fcskip %patch5 -p1 -b .fcskip
%patch6 -p1 -b .matchpathcon %patch6 -p1 -b .matchpathcon
%patch7 -p1 -b .poptver %patch7 -p1 -b .poptver
%patch8 -p1 -b .queryiter
%build %build
@ -429,6 +431,9 @@ exit 0
%{__includedir}/popt.h %{__includedir}/popt.h
%changelog %changelog
* Thu Jun 28 2007 Panu Matilainen <pmatilai@redhat.com> 4.4.2.1-0.3.rc1
- don't hang because of leftover query iterators (#246044)
* Tue Jun 26 2007 Panu Matilainen <pmatilai@redhat.com> 4.4.2.1-0.2.rc1 * Tue Jun 26 2007 Panu Matilainen <pmatilai@redhat.com> 4.4.2.1-0.2.rc1
- patch popt version to 1.10.2.1 for clean upgrade path - patch popt version to 1.10.2.1 for clean upgrade path
- popt release follows main package release again - popt release follows main package release again