Bug 752952

Summary: totemip_parse leaks memory
Product: Red Hat Enterprise Linux 5 Reporter: Steven Dake <sdake>
Component: openaisAssignee: Jan Friesse <jfriesse>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: low Docs Contact:
Priority: low    
Version: 5.7CC: asalkeld, cluster-maint, edamato, jkortus
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openais-0.80.6-36.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 752951 Environment:
Last Closed: 2012-02-21 05:23:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 752951    
Bug Blocks:    
Attachments:
Description Flags
add call to freeaddrinfo() none

Description Steven Dake 2011-11-10 20:29:21 UTC
+++ This bug was initially created as a clone of Bug #752951 +++

Description of problem:
totemip_parse uses getaddrinfo without using an associated freeaddrinfo call.

Version-Release number of selected component (if applicable):
corosync-1.4.1-1.el6

How reproducible:
requires valgrind analysis

Steps to Reproduce:
1.
2.
3.
  
Actual results:
some minimal amount of memory will be leaked when this api is called.  This function is not called often, but is called enough that over several months it could add up.

Expected results:
no leaks with getaddrinfo.

Additional info:
[corosync] [PATCH 1/7] Free mem allocated by getaddrinfo

Comment 2 Angus Salkeld 2011-11-14 23:11:47 UTC
Here is the valgrind snippet

sudo valgrind --leak-check=full /usr/local/sbin/aisexec -f

[snip]

==15126== 64 bytes in 1 blocks are definitely lost in loss record 16 of 42
==15126==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==15126==    by 0x39BCCD8793: gaih_inet (in /lib64/libc-2.14.90.so)
==15126==    by 0x39BCCDBBCD: getaddrinfo (in /lib64/libc-2.14.90.so)
==15126==    by 0x40790D: totemip_parse (in /usr/local/sbin/aisexec)
==15126==    by 0x41FC8E: totem_config_read (in /usr/local/sbin/aisexec)
==15126==    by 0x405CD1: main (in /usr/local/sbin/aisexec)

Comment 3 Angus Salkeld 2011-11-14 23:14:03 UTC
Created attachment 533649 [details]
add call to freeaddrinfo()

Comment 7 errata-xmlrpc 2012-02-21 05:23:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0180.html