[mod_xml_ldap] Fix potential memory leaks in xml_ldap_search()

This commit is contained in:
Andrey Volk 2022-01-05 01:49:16 +03:00
parent d38d83339d
commit 1f9305098d
1 changed files with 2 additions and 0 deletions

View File

@ -721,8 +721,10 @@ static switch_xml_t xml_ldap_search(const char *section, const char *tag_name, c
case XML_LDAP_DIRECTORY:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "from cb got %s=%s\n", hi->name, hi->value);
if (!strncmp(hi->name, "user", strlen(hi->name))) {
switch_safe_free(dir_exten);
dir_exten = strdup(hi->value);
} else if (!strncmp(hi->name, "domain", strlen(hi->name))) {
switch_safe_free(dir_domain);
dir_domain = strdup(hi->value);
}
break;