aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-12-09 15:55:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-12-09 15:55:29 +0000
commita056e218cd7d87e10e8f546fe20d02e992160011 (patch)
tree045a24ca855a55d6d5ae04994712c35a7de47d66 /URPM.xs
parente9fe57d21a973a32460c6871e701981698f05d16 (diff)
downloadperl-URPM-a056e218cd7d87e10e8f546fe20d02e992160011.tar
perl-URPM-a056e218cd7d87e10e8f546fe20d02e992160011.tar.gz
perl-URPM-a056e218cd7d87e10e8f546fe20d02e992160011.tar.bz2
perl-URPM-a056e218cd7d87e10e8f546fe20d02e992160011.tar.xz
perl-URPM-a056e218cd7d87e10e8f546fe20d02e992160011.zip
free the iterator *after* use
(otherwise it segfaults with 4.6.0-rc1, and i wonder how it worked before...)
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs6
1 files changed, 4 insertions, 2 deletions
diff --git a/URPM.xs b/URPM.xs
index 2fb9181..f36ddd1 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -731,8 +731,7 @@ return_problems(rpmps ps, int translate_message, int raw_message) {
if (ps && rpmpsNumProblems(ps) > 0) {
#ifdef RPM_ORG
rpmpsi iterator = rpmpsInitIterator(ps);
- rpmpsFreeIterator(iterator);
- while (rpmpsNextIterator(iterator)) {
+ while (rpmpsNextIterator(iterator) >= 0) {
rpmProblem p = rpmpsGetProblem(iterator);
#else
int i;
@@ -791,6 +790,9 @@ return_problems(rpmps ps, int translate_message, int raw_message) {
XPUSHs(sv_2mortal(sv));
}
}
+#ifdef RPM_ORG
+ rpmpsFreeIterator(iterator);
+#endif
}
PUTBACK;
}