Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 613438 - dev-libs/libtar-1.2.20-r3 tar_open memory leak (patch included)
Summary: dev-libs/libtar-1.2.20-r3 tar_open memory leak (patch included)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal major (vote)
Assignee: Nick Andrade
URL:
Whiteboard:
Keywords:
Depends on: 648936
Blocks:
  Show dependency tree
 
Reported: 2017-03-21 22:57 UTC by Michał Łyszczek
Modified: 2018-02-27 13:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch fixing memory leak (libtar-1.2.20-memleak-open-enoent.patch,285 bytes, patch)
2017-03-21 22:58 UTC, Michał Łyszczek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(+)