diff --git a/gst/multifile/gstmultifilesink.c b/gst/multifile/gstmultifilesink.c index c74c20bdda..5d2878662c 100644 --- a/gst/multifile/gstmultifilesink.c +++ b/gst/multifile/gstmultifilesink.c @@ -627,8 +627,10 @@ gst_multi_file_sink_write_buffer (GstMultiFileSink * multifilesink, "Writing buffer data (%" G_GSIZE_FORMAT " bytes) to new file", map.size); ret = fwrite (map.data, map.size, 1, multifilesink->file); - if (ret != 1) + if (ret != 1) { + gst_multi_file_sink_close_file (multifilesink, NULL); goto stdio_write_error; + } gst_multi_file_sink_close_file (multifilesink, buffer); break;