summaryrefslogtreecommitdiff
path: root/res/res_config_ldap.c
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2010-01-14 23:13:02 +0000
committerSean Bright <sean@malleable.com>2010-01-14 23:13:02 +0000
commit37b73283ff4308e7840e65bd8b6aa7b9b3a15542 (patch)
tree97609939222ffbc3b8e544dae7f4690fa3019c0a /res/res_config_ldap.c
parentcd2ba30e9eb37b022aa543b42baeee4a6bc411c9 (diff)
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/trunk@240271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_config_ldap.c')
-rw-r--r--res/res_config_ldap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c
index 3e0b8e106..8496d801a 100644
--- a/res/res_config_ldap.c
+++ b/res/res_config_ldap.c
@@ -378,8 +378,10 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg);
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) {