Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 613438

Summary: dev-libs/libtar-1.2.20-r3 tar_open memory leak (patch included)
Product: Gentoo Linux Reporter: Michał Łyszczek <michal.lyszczek>
Component: Current packagesAssignee: Nick Andrade <SDNick484>
Status: RESOLVED FIXED    
Severity: major    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 648936    
Bug Blocks:    
Attachments: patch fixing memory leak

Description Michał Łyszczek 2017-03-21 22:57:15 UTC
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
Comment 1 Michał Łyszczek 2017-03-21 22:58:43 UTC
Created attachment 467872 [details, diff]
patch fixing memory leak
Comment 2 Larry the Git Cow gentoo-dev 2018-02-17 13:37:38 UTC
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(+)