]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't deref NULL. Found by Klockwork (www.klocwork.com)
authorMichael Jerris <mike@jerris.com>
Mon, 19 May 2008 19:45:50 +0000 (19:45 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 19 May 2008 19:45:50 +0000 (19:45 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8473 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_play_say.c

index a2c892d0689d59f21560fc7dc728c403940d5b80..df75f747cdd95657ba36882b415217350f43cdfe 100644 (file)
@@ -721,12 +721,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
                        const char *lang = switch_channel_get_variable(channel, "language");
                        alt = file + 7;
                        dup = switch_core_session_strdup(session, alt);
-
-                       if ((arg = strchr(dup, ':'))) {
-                               *arg++ = '\0';
-                       }
                        
                        if (dup) {
+                               if ((arg = strchr(dup, ':'))) {
+                                       *arg++ = '\0';
+                               }
                                return switch_ivr_phrase_macro(session, dup, arg, lang, args);
                        } else {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Args\n");