]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix edge case segfault
authorMichael Jerris <mike@jerris.com>
Fri, 20 Mar 2009 22:49:01 +0000 (22:49 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 20 Mar 2009 22:49:01 +0000 (22:49 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12697 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_async.c

index 14b5e03b8e32b0bd5aa25c120c16bb1cb7a93984..23686196115f2934007d3aef228fd82b5843dd30 100644 (file)
@@ -448,11 +448,10 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
                        
                        if (rh->fh) {
                                switch_core_file_close(rh->fh);
-                       }
-               
-                       if (rh->fh->samples_out < read_impl.samples_per_second * 3) {
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Discarding short file %s\n", rh->file);
-                               switch_file_remove(rh->file, switch_core_session_get_pool(session));
+                               if (rh->fh->samples_out < read_impl.samples_per_second * 3) {
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Discarding short file %s\n", rh->file);
+                                       switch_file_remove(rh->file, switch_core_session_get_pool(session));
+                               }
                        }
                }