]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5791 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 14 Sep 2013 15:07:25 +0000 (10:07 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 14 Sep 2013 16:01:50 +0000 (21:01 +0500)
src/switch_ivr_async.c

index 3b0726fda8cc148e58d3fbdba2aeeb06f011b907..03f1aa126dd81bc4e252f9f25308992b70154e7b 100644 (file)
@@ -2253,7 +2253,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
        if ((status = switch_core_media_bug_add(session, "session_record", file,
                                                                                        record_callback, rh, to, flags, &bug)) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error adding media bug for file %s\n", file);
-               switch_core_file_close(fh);
+               if (rh->native) {
+                       switch_core_file_close(&rh->in_fh);
+                       switch_core_file_close(&rh->out_fh);
+               } else
+                       switch_core_file_close(fh);
+               }
                return status;
        }