aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-14 18:23:53 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-14 18:23:53 +0000
commit8415bd7e2e880231a78efecd1693e41d889960df (patch)
tree6e619efa24a200320979e97fd5993d1d15df77b8 /URPM.xs
parentdc65c01ee09b29731b1623a6c54734847c07d5af (diff)
downloadperl-URPM-8415bd7e2e880231a78efecd1693e41d889960df.tar
perl-URPM-8415bd7e2e880231a78efecd1693e41d889960df.tar.gz
perl-URPM-8415bd7e2e880231a78efecd1693e41d889960df.tar.bz2
perl-URPM-8415bd7e2e880231a78efecd1693e41d889960df.tar.xz
perl-URPM-8415bd7e2e880231a78efecd1693e41d889960df.zip
(return_files) use proper API for freeing memory
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs10
1 files changed, 6 insertions, 4 deletions
diff --git a/URPM.xs b/URPM.xs
index d792539..f23664e 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -699,9 +699,10 @@ return_files(const Header header, int filter_mode) {
char **baseNames = td_baseNames.data;
char **dirNames = td_dirNames.data;
int32_t *dirIndexes = td_dirIndexes.data;
+ int is_oldfilenames = !baseNames || !dirNames || !dirIndexes;
char **list = NULL;
- if (!baseNames || !dirNames || !dirIndexes) {
+ if (is_oldfilenames) {
if (!headerGet(header, RPMTAG_OLDFILENAMES, &td_list, HEADERGET_DEFAULT))
return;
list = td_list.data;
@@ -729,9 +730,10 @@ return_files(const Header header, int filter_mode) {
mXPUSHs(newSVpv(s, len));
}
- free(baseNames);
- free(dirNames);
- free(list);
+ rpmtdFreeData(&td_baseNames);
+ rpmtdFreeData(&td_dirNames);
+ if (is_oldfilenames)
+ rpmtdFreeData(&td_list);
}
PUTBACK;
}