[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:10:07 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
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:                     closed
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:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2010-12-07 18:07 CST
Last Modified:              2011-01-29 17:10 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)
====================================================================== 

---------------------------------------------------------------------- 
 (0131227) svnbot (reporter) - 2011-01-29 17:10
 https://issues.asterisk.org/view.php?id=18435#c131227 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 304867

_U  trunk/
U   trunk/res/res_config_ldap.c

------------------------------------------------------------------------
r304867 | seanbright | 2011-01-29 17:10:06 -0600 (Sat, 29 Jan 2011) | 21
lines

Merged revisions 304866 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r304866 | seanbright | 2011-01-29 18:07:18 -0500 (Sat, 29 Jan 2011) | 14
lines
  
  Merged revisions 304865 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r304865 | seanbright | 2011-01-29 18:05:25 -0500 (Sat, 29 Jan 2011) |
7 lines
    
    Plug some memory leaks in the LDAP realtime driver.
    
    (closes issue https://issues.asterisk.org/view.php?id=18435)
    Reported by: zaltar
    Patches:
          res_config_ldap.patch uploaded by zaltar (license 1148)
  ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=304867 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-29 17:10 svnbot         Checkin                                      
2011-01-29 17:10 svnbot         Note Added: 0131227                          
======================================================================




More information about the asterisk-bugs mailing list