From: Andrey Volk Date: Tue, 4 Jan 2022 22:49:16 +0000 (+0300) Subject: [mod_xml_ldap] Fix potential memory leaks in xml_ldap_search() X-Git-Tag: v1.10.8^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f9305098d4d9b3b56512997ef80ba72390f0aa5;p=thirdparty%2Ffreeswitch.git [mod_xml_ldap] Fix potential memory leaks in xml_ldap_search() --- diff --git a/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c b/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c index eecdb49549..a28d91a44a 100644 --- a/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c +++ b/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c @@ -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;