diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-14 23:13:02 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-14 23:13:02 +0000 |
commit | cc755d40a9640b1fc80973c86cf4aa6d5128f772 (patch) | |
tree | 97609939222ffbc3b8e544dae7f4690fa3019c0a /res | |
parent | 44ac5b2fb645a14fe761435f0341b97ca4bb20cc (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: http://svn.digium.com/svn/asterisk/trunk@240271 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_config_ldap.c | 4 |
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) { |