]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_xml_ldap] Fix potential memory leaks in xml_ldap_search()
authorAndrey Volk <andywolk@gmail.com>
Tue, 4 Jan 2022 22:49:16 +0000 (01:49 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 9 Aug 2022 21:10:47 +0000 (00:10 +0300)
src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c

index eecdb495493e07ff6f88aa6e259c51c6fbd83c80..a28d91a44ae6fcc227d8d14eadef06e38926b71e 100644 (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;