]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] Fix potential memory leak in sofia_reg_handle_sip_r_challenge()
authorAndrey Volk <andywolk@gmail.com>
Tue, 4 Jan 2022 22:46:21 +0000 (01:46 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 9 Aug 2022 20:33:21 +0000 (23:33 +0300)
src/mod/endpoints/mod_sofia/sofia_reg.c

index 42c792c08b44249900787525d35529aa34002985..9791190f5f7275cd16f62ce5c6b8dd6eb48da87f 100644 (file)
@@ -2810,9 +2810,11 @@ void sofia_reg_handle_sip_r_challenge(int status,
                                        const char *val = switch_xml_attr_soft(x_param, "value");
 
                                        if (!strcasecmp(var, "reverse-auth-user")) {
+                                               switch_safe_free(dup_user);
                                                dup_user = strdup(val);
                                                sip_auth_username = dup_user;
                                        } else if (!strcasecmp(var, "reverse-auth-pass")) {
+                                               switch_safe_free(dup_pass);
                                                dup_pass = strdup(val);
                                                sip_auth_password = dup_pass;
                                        }