aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-29 23:05:25 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-29 23:05:25 +0000
commit44c36f139c76db31ac201876eeda5c7ec4624c23 (patch)
tree00c97de6c0931462c56cf13019566b264adbd614
parent4700f8d3464525ce3405d4d00e6fb9e2d832798f (diff)
Plug some memory leaks in the LDAP realtime driver.
(closes issue #18435) Reported by: zaltar Patches: res_config_ldap.patch uploaded by zaltar (license 1148) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@304865 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_config_ldap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c
index 6c91ccc98..2c285bdcf 100644
--- a/res/res_config_ldap.c
+++ b/res/res_config_ldap.c
@@ -330,6 +330,7 @@ static struct ast_variable *realtime_ldap_entry_to_var(struct ldap_table_config
}
ldap_value_free_len(values);
}
+ ldap_memfree(ldap_attribute_name);
ldap_attribute_name = ldap_next_attribute(ldapConn, ldap_entry, ber);
}
ber_free(ber, 0);
@@ -496,6 +497,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
} /*!< for (v = values; *v; v++) */
ldap_value_free_len(values);
}/*!< if (values) */
+ ldap_memfree(ldap_attribute_name);
ldap_attribute_name = ldap_next_attribute(ldapConn, ldap_entry, ber);
} /*!< while (ldap_attribute_name) */
ber_free(ber, 0);
@@ -1311,7 +1313,7 @@ static int update_ldap(const char *basedn, const char *table_name, const char *a
dn = ldap_get_dn(ldapConn, ldap_entry);
if ((error = ldap_modify_ext_s(ldapConn, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS)
ast_log(LOG_ERROR, "Couldn't modify dn:%s because %s", dn, ldap_err2string(error));
-
+ ldap_memfree(dn);
ldap_entry = ldap_next_entry(ldapConn, ldap_entry);
}
}
@@ -1493,7 +1495,7 @@ static int update2_ldap(const char *basedn, const char *table_name, va_list ap)
dn = ldap_get_dn(ldapConn, ldap_entry);
if ((error = ldap_modify_ext_s(ldapConn, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS)
ast_log(LOG_ERROR, "Couldn't modify dn:%s because %s", dn, ldap_err2string(error));
-
+ ldap_memfree(dn);
ldap_entry = ldap_next_entry(ldapConn, ldap_entry);
}
}