Bug 859717 - memory leak with getaddrinfo()
memory leak with getaddrinfo()
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Jeff Law
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-09-23 10:04 EDT by Noam Meltzer
Modified: 2016-11-24 10:56 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-09-24 09:38:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
example code to recreate the memory leak (1.10 KB, text/plain)
2012-09-23 10:04 EDT, Noam Meltzer
no flags Details

  None (edit)
Description Noam Meltzer 2012-09-23 10:04:46 EDT
Created attachment 616108 [details]
example code to recreate the memory leak

Description of problem:
getaddrinfo() leaks memory

Version-Release number of selected component (if applicable):
kernel: 3.5.3-1.fc17.x86_64

How reproducible:
always using attached code

Steps to Reproduce:
1. cc     leak.c   -o leak

2. valgrind --leak-check=full --show-reachable=yes ./leak localhost

Actual results:

==11543== 240 bytes in 1 blocks are still reachable in loss record 1 of 1
==11543==    at 0x4C2884D: malloc (vg_replace_malloc.c:263)
==11543==    by 0x4F449FB: make_request (check_pf.c:250)
==11543==    by 0x4F44C55: __check_pf (check_pf.c:343)
==11543==    by 0x4F0BF08: getaddrinfo (getaddrinfo.c:2305)
==11543==    by 0x400716: ip_from_string (in /home/noam/sources/getaddrinfo.bug/leak)
==11543==    by 0x400822: main (in /home/noam/sources/getaddrinfo.bug/leak)


Expected results:

Additional info:
I also have Fedora15 machine which doesn't show this problem.
Comment 1 Jeff Law 2012-09-24 09:38:03 EDT
This does not appear in F15 because F15 doesn't cache information WRT what interfaces are available.

The memory leak is fixed in F18 & rawhide.  It's a low priority issue as only a single object is leaked (rather than an object per call) and there aren't currently plans to backport the fix to F17.

Note You need to log in before you can comment on or make changes to this bug.