[FFmpeg-cvslog] avformat/hlsenc: move old_filename free operation earlier

Steven Liu git at videolan.org
Thu May 11 05:16:31 EEST 2017


ffmpeg | branch: master | Steven Liu <lq at chinaffmpeg.org> | Thu May 11 10:15:08 2017 +0800| [7355c1dda2f8f21f699e720700c26dc8a666c6ec] | committer: Steven Liu

avformat/hlsenc: move old_filename free operation earlier

Suggested-by: Aaron Levinson <alevinsn at aracnet.com>
Reviewed-by: Aaron Levinson <alevinsn at aracnet.com>
Signed-off-by: Steven Liu <lq at chinaffmpeg.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7355c1dda2f8f21f699e720700c26dc8a666c6ec
---

 libavformat/hlsenc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 221089c1be..7ed121a5dd 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1549,14 +1549,13 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
             sls_flag_file_rename(hls, old_filename);
             ret = hls_start(s);
         }
+        av_free(old_filename);
 
         if (ret < 0) {
-            av_free(old_filename);
             return ret;
         }
 
         if ((ret = hls_window(s, 0)) < 0) {
-            av_free(old_filename);
             return ret;
         }
     }



More information about the ffmpeg-cvslog mailing list