When tar_open file that doesn't exist, libtar doesn't free memory alocated by libtar_hash_new during opening which leads to memory leak. Reproducible: Always Steps to Reproduce: 1. tar_open() with non existing file 2. 3. Actual Results: Memory should be fully freed upon error Expected Results: Memory is not entirely freed by libtar upon tar_open failure
Created attachment 467872 [details, diff] patch fixing memory leak
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24195ad7e78da44b9a5856d227c592ab9482ab49 commit 24195ad7e78da44b9a5856d227c592ab9482ab49 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2018-02-17 12:03:32 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2018-02-17 13:37:21 +0000 dev-libs/libtar: Fix various memleaks and filedescriptor-leaks Thanks-to: Michał Łyszczek <michal.lyszczek@gmail.com> Closes: https://bugs.gentoo.org/613438 Package-Manager: Portage-2.3.24, Repoman-2.3.6 .../libtar/files/libtar-1.2.20-bin-memleaks.patch | 117 +++++++++++++++++++++ dev-libs/libtar/files/libtar-1.2.20-fd-leaks.patch | 98 +++++++++++++++++ .../files/libtar-1.2.20-tar_open-memleak.patch | 24 +++++ dev-libs/libtar/libtar-1.2.20-r4.ebuild | 3 + 4 files changed, 242 insertions(+)