]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 240271 via svnmerge from
authorSean Bright <sean@malleable.com>
Thu, 14 Jan 2010 23:18:30 +0000 (23:18 +0000)
committerSean Bright <sean@malleable.com>
Thu, 14 Jan 2010 23:18:30 +0000 (23:18 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r240271 | seanbright | 2010-01-14 18:13:02 -0500 (Thu, 14 Jan 2010) | 7 lines

  Plug a memory leak in res_config_ldap.

  (closes issue #16257)
  Reported by: nito
  Patches:
        issue16257_20100111.diff uploaded by seanbright (license 71)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@240278 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_config_ldap.c

index 91f526e564a81f696e8020044a8283ebb7a3829c..33c163001423899f5a3ea8a794323fec00ea2d15 100644 (file)
@@ -364,8 +364,10 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
        ldap_entry = ldap_first_entry(ldapConn, ldap_result);
 
        for (tot_count = 0; ldap_entry; tot_count++){ 
-               tot_count += semicolon_count_var(realtime_ldap_entry_to_var(table_config, ldap_entry));
+               struct ast_variable *tmp = realtime_ldap_entry_to_var(table_config, ldap_entry);
+               tot_count += semicolon_count_var(tmp);
                ldap_entry = ldap_next_entry(ldapConn, ldap_entry);
+               ast_variables_destroy(tmp);
        }
 
        if (entries_count_ptr)