aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-12-15 11:05:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-12-15 11:05:31 +0000
commit25ca91a66d8be65e5a0aa544e2deefdde4b38f7a (patch)
tree4555afcb606ce95d9c7a13413d9b3a71b3152fdc
parent3997478673f694c20b3ca8fbcd39feff23215437 (diff)
downloadperl-URPM-25ca91a66d8be65e5a0aa544e2deefdde4b38f7a.tar
perl-URPM-25ca91a66d8be65e5a0aa544e2deefdde4b38f7a.tar.gz
perl-URPM-25ca91a66d8be65e5a0aa544e2deefdde4b38f7a.tar.bz2
perl-URPM-25ca91a66d8be65e5a0aa544e2deefdde4b38f7a.tar.xz
perl-URPM-25ca91a66d8be65e5a0aa544e2deefdde4b38f7a.zip
- fix bad free() (thanks to glibc for detecting it)
-rw-r--r--NEWS2
-rw-r--r--URPM.xs8
2 files changed, 6 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 373e2ee..c20c842 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- fix bad free() (thanks to glibc for detecting it)
+
Version 3.22 - 12 December 2008, by Pascal "Pixel" Rigaux
- fix scriptlet failing:
diff --git a/URPM.xs b/URPM.xs
index 13fa296..cfbfad1 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -468,14 +468,14 @@ return_list_str(char *s, Header header, int32_t tag_name, int32_t tag_flags, int
if (f(NULL, 0, rpmtdGetString(&list), flag ? *flag : 0,
rpmtdNextString(&list_evr), param)) {
rpmtdFreeData(&list);
- rpmtdFreeData(&flags);
- rpmtdFreeData(&list_evr);
+ if (tag_flags) rpmtdFreeData(&flags);
+ if (tag_version) rpmtdFreeData(&list_evr);
return -count;
}
}
rpmtdFreeData(&list);
- rpmtdFreeData(&flags);
- rpmtdFreeData(&list_evr);
+ if (tag_flags) rpmtdFreeData(&flags);
+ if (tag_version) rpmtdFreeData(&list_evr);
}
}
return count;