diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-14 18:23:53 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-14 18:23:53 +0000 |
commit | 8415bd7e2e880231a78efecd1693e41d889960df (patch) | |
tree | 6e619efa24a200320979e97fd5993d1d15df77b8 /URPM.xs | |
parent | dc65c01ee09b29731b1623a6c54734847c07d5af (diff) | |
download | perl-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.xs | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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; } |