]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11818 [core] fix memory leak when using dial handle in switch_ivr_originate()
authorChris Rienzo <chris@signalwire.com>
Sat, 27 Apr 2019 21:20:36 +0000 (17:20 -0400)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Jul 2019 19:04:02 +0000 (23:04 +0400)
src/switch_ivr_originate.c

index f482809994bf9ad4ec7c3cbfac2935aaeb24aa2c..bb3bf27abf4ba85cfe975f848db0eb49ac06861c 100644 (file)
@@ -2182,10 +2182,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                || switch_true(switch_core_get_variable("origination_nested_vars")) || switch_stristr("origination_nested_vars=true", data)) {
                oglobals.check_vars = SWITCH_FALSE;
        }
-       
+
        if (dh) {
                switch_event_t *vp = switch_dial_handle_get_global_vars(dh);
                if (vp) {
+                       if (var_event && var_event != ovars) {
+                               switch_event_destroy(&var_event);
+                       }
                        switch_event_dup(&var_event, vp);
                }
        }