[asterisk-bugs] [Asterisk 0018435]: [patch] Memory leak in res_config_ldap when using realtime

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Jan 29 17:05:27 CST 2011


The following issue has been ASSIGNED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18435 
====================================================================== 
Reported By:                zaltar
Assigned To:                seanbright
====================================================================== 
Project:                    Asterisk
Issue ID:                   18435
Category:                   Resources/res_config_ldap
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
JIRA:                       SWP-2736 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 297904 
Request Review:              
====================================================================== 
Date Submitted:             2010-12-07 18:07 CST
Last Modified:              2011-01-29 17:05 CST
====================================================================== 
Summary:                    [patch] Memory leak in res_config_ldap when using
realtime
Description: 
Found three places where memory was leaked using realtime with ldap on
1.8.0.  Patch is against trunk (rev 297904)

==13451== Memcheck, a memory error detector
==13451== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==13451== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright
info
==13451== Command: asterisk -f -vvv -cd
==13451== Parent PID: 14587

==13451==
==13451== 8,182 bytes in 499 blocks are definitely lost in loss record
2,797 of 2,931
==13451==    at 0x4A05E1C: malloc (vg_replace_malloc.c:195)
==13451==    by 0x3988608AC4: ber_memalloc_x (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x3988603B4C: ber_get_stringbv (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x3988603D39: ber_get_stringa (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x3988604C18: ber_scanf (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x31A7A1D7FE: ldap_next_attribute (in
/usr/lib64/libldap-2.4.so.2.1.0)
==13451==    by 0xDB06693: realtime_ldap_entry_to_var
(res_config_ldap.c:346)
==13451==    by 0xDB06776: realtime_ldap_result_to_vars
(res_config_ldap.c:379)
==13451==    by 0xDB085C1: realtime_ldap_base_ap (res_config_ldap.c:828)
==13451==    by 0xDB08BDB: realtime_multi_ldap (res_config_ldap.c:977)
==13451==    by 0x494826: ast_load_realtime_multientry (config.c:2253)
==13451==    by 0xEA3E781: load_realtime_queue (app_queue.c:2184)



==13451==    
==13451== 3,280 bytes in 200 blocks are definitely lost in loss record
2,687 of 2,931
==13451==    at 0x4A05E1C: malloc (vg_replace_malloc.c:195)
==13451==    by 0x3988608AC4: ber_memalloc_x (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x3988603B4C: ber_get_stringbv (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x3988603D39: ber_get_stringa (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x3988604C18: ber_scanf (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x31A7A1D7FE: ldap_next_attribute (in
/usr/lib64/libldap-2.4.so.2.1.0)
==13451==    by 0xDB0713B: realtime_ldap_result_to_vars
(res_config_ldap.c:511)
==13451==    by 0xDB085C1: realtime_ldap_base_ap (res_config_ldap.c:828) 
==13451==    by 0xDB08BDB: realtime_multi_ldap (res_config_ldap.c:977)
==13451==    by 0x494826: ast_load_realtime_multientry (config.c:2253)
==13451==    by 0xEA3E781: load_realtime_queue (app_queue.c:2184)
==13451==    by 0xEA515C8: __queues_show (app_queue.c:6755)


==13451==
==13451== 156 bytes in 4 blocks are definitely lost in loss record 1,725
of 2,931
==13451==    at 0x4A05E1C: malloc (vg_replace_malloc.c:195)
==13451==    by 0x3988608AC4: ber_memalloc_x (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x3988603B4C: ber_get_stringbv (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x3988603D39: ber_get_stringa (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x3988604C18: ber_scanf (in
/usr/lib64/liblber-2.4.so.2.1.0)
==13451==    by 0x31A7A1AADB: ldap_get_dn (in
/usr/lib64/libldap-2.4.so.2.1.0)
==13451==    by 0xDB0A70E: update_ldap (res_config_ldap.c:1340)
==13451==    by 0x4949AB: ast_update_realtime (config.c:2277)
==13451==    by 0xE55FE74: realtime_update_peer (chan_sip.c:4223)
==13451==    by 0xE560756: update_peer (chan_sip.c:4353)
==13451==    by 0xE591987: register_verify (chan_sip.c:13798)
==13451==    by 0xE5C4987: handle_request_register (chan_sip.c:23388)
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-29 17:05 svnbot         Status                   ready for review =>
assigned
2011-01-29 17:05 svnbot         Assigned To               => seanbright      
======================================================================




More information about the asterisk-bugs mailing list