]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix for FSCORE-29 (needs testing)
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 21 May 2007 21:57:20 +0000 (21:57 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 21 May 2007 21:57:20 +0000 (21:57 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5209 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index 3f4e88580536705db7e2595ca3cbd989179d2710..218d665e3a12b29117c7febedf1fe386e0cd18b6 100644 (file)
@@ -260,7 +260,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
        switch_codec_t write_codec = { 0 };
        switch_frame_t write_frame = { 0 };
        uint8_t fdata[1024], pass = 0;
-       char *file = NULL, *key = NULL, *odata, *var;
+       char key[80] = "", file[512] = "", *odata, *var;
        switch_call_cause_t reason = SWITCH_CAUSE_UNALLOCATED;
        uint8_t to = 0;
        char *var_val, *vars = NULL, *ringback_data = NULL;
@@ -362,9 +362,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
        }
 
        if ((var = switch_event_get_header(var_event, "group_confirm_key"))) {
-               key = switch_core_session_strdup(session, var);
+               switch_copy_string(key, var, sizeof(key));
                if ((var = switch_event_get_header(var_event, "group_confirm_file"))) {
-                       file = switch_core_session_strdup(session, var);
+                       switch_copy_string(file, var, sizeof(file));
                }
        }
        // When using the AND operator, the fail_on_single_reject flag may be set in order to indicate that a single
@@ -373,8 +373,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                fail_on_single_reject = 1;
        }
 
-       if (file && !strcmp(file, "undef")) {
-               file = NULL;
+       if (!switch_strlen_zero(file) && !strcmp(file, "undef")) {
+               *file = '\0';
        }
 
        if ((var_val = switch_event_get_header(var_event, "ignore_early_media")) && switch_true(var_val)) {
@@ -440,8 +440,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                        read_frame = NULL;
                        pool = NULL;
                        pass = 0;
-                       file = NULL;
-                       key = NULL;
                        var = NULL;
                        to = 0;