From patchwork Wed Oct 9 07:35:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 15585 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 1E1AF446F3E for ; Wed, 9 Oct 2019 10:35:52 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E9A196880C2; Wed, 9 Oct 2019 10:35:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpproxy21.qq.com (smtpbg704.qq.com [203.205.195.105]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA07B680A43 for ; Wed, 9 Oct 2019 10:35:44 +0300 (EEST) X-QQ-mid: bizesmtp24t1570606535t8b9b1xc Received: from localhost (unknown [47.90.47.25]) by esmtp10.qq.com (ESMTP) with id ; Wed, 09 Oct 2019 15:35:35 +0800 (CST) X-QQ-SSF: 01100000002000K0ZRF1000A0000000 X-QQ-FEAT: fVZeSYFzHq2UNQawIOLry1mjWyxDTwd4oQoBPoZ6RdqGNG50h3ynLsY0h5/JB gbxD+qn3b+F1oVG+hFKkwmW7KMtERITEZfllglXLAmVV2yyjZn1Clqxz3fn1OEEctzdoulV 9e9vaYdFq5CwX7MkFdPWiJmPSMbLNKxdXoMWdg3Zwax10AJr+lugfLMMUTnFLbpkn0GynxX 2hShbbADM+HmJ277JxGJ8gBxg9gx1egcsv8hX3SswsHmSey3RK9iiha3VPzialuvUcwmN6F I/fr1/iMWEKjHMvizA9HKV1aI2THkXaaixtjfY10ZQTWQp3COZdFvWRb+5ki1ibwew6w== X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Wed, 9 Oct 2019 15:35:21 +0800 Message-Id: <20191009073530.4505-2-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.10.1.382.ga23ca1b.dirty In-Reply-To: <20191009073530.4505-1-lq@chinaffmpeg.org> References: <20191009073530.4505-1-lq@chinaffmpeg.org> X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v1 02/11] avformat/hlsenc: fix memleak of vtt_dirname_r in hls_delete_old_segments X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Steven Liu --- libavformat/hlsenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index a1c03dbed5..a689acc2e0 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -575,6 +575,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls, if ((segment->sub_filename[0] != '\0')) { char *vtt_dirname_r = av_strdup(vs->vtt_avf->url); vtt_dirname = (char*)av_dirname(vtt_dirname_r); + av_freep(&vtt_dirname_r); sub_path_size = strlen(segment->sub_filename) + 1 + strlen(vtt_dirname); sub_path = av_malloc(sub_path_size); if (!sub_path) {