From patchwork Mon May 8 10:35:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 3602 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp656510vsd; Sun, 7 May 2017 19:36:51 -0700 (PDT) X-Received: by 10.28.209.131 with SMTP id i125mr10919093wmg.57.1494211011489; Sun, 07 May 2017 19:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494211011; cv=none; d=google.com; s=arc-20160816; b=T4at7TeVJwWiejYdSgRP+4dK3GddWjikDjXoOE7fckQbKkJWYAgZyzNN8p79Nt/1fY GmjP/oJWO8ZQJHqV1uzZS5RB2LNU+WVjYakzpPtgfvNV94CicLBgeNYcdyN1oTIKlgQj mb+pxU67F0qGc+lQJU1UeiAIkE3QAIVVy8Ferlrc9ha5HlqICvcVQsKuvUK2qugloYh7 v4IZavA+qXhWxqGVx98aWiUTcyWtxKBUFf9JWR2XGsW44zC3yMEitB7+Q4fVTV1OkIof H/eKOsScBC0QT6WC4yEo32fvcETCLJ8HauB8mbBHqNRY4Cmy4n2k5p1Do0yb8AR6LUcK u6ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=LPY5qQ5Wa+wJVYQrP5Ppha00Lv2bTDN4gnXNdy8nQYs=; b=f3cMoJ60MhT5nHA8VL+Z5o2vynCf1pzGSDWCn4FetnhhxZVFaI6Rjdn08978SPFosz 8x7lQBV1a6xX5O7U/XafGBSC8GnzpQVQO6YHypy99IohHMa9pWwsaDQEXYmSsRAr4mQb 64/qRyg5Qej4uw6ft3+p3Q+pAzjNFQdUo8+VsEiHxe/J1LfR5DSB5/5EP5PX2Ln9kAyl gJnUHpuM69f+Ejf3EBFP89o4C8lzpzm2PsBc4V6O5/fzpBdz5DswFiawDqf2yNAiHrVn NitdDWmEU8mJiXIMb9m9j9fQNOe7aZUg+KEpWkIJ9G0MsQbzhOFDHpYFKddziRIGPMCM qTGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f56si13618158wrf.116.2017.05.07.19.36.50; Sun, 07 May 2017 19:36:51 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A1EE8680AB5; Mon, 8 May 2017 05:36:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbg342.qq.com (smtpbg342.qq.com [14.17.44.37]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 197F0680578 for ; Mon, 8 May 2017 05:36:33 +0300 (EEST) X-QQ-mid: bizesmtp15t1494210946tcuhsyyf Received: from localhost (unknown [114.255.44.132]) by esmtp4.qq.com (ESMTP) with id ; Mon, 08 May 2017 10:35:44 +0800 (CST) X-QQ-SSF: 01100000002000F0FF40B00A0000000 X-QQ-FEAT: Q4mUGnBphwN7p9Qo8bLhOn1jUSt+h6fJJ0Rp9+j02yqUWY5xp29vL3+3mr+6f eRz1ImZsUbtH0Rok9oNrG0dwKIKbFoCyVqDolKttH1/maZ+jUfeEtqH3DIxiQ8m0VtqJJwd Q/SXOddSClJDc8+WDEgP25QlK7jlC3UDEMYi0cIK8FrqS1cZjfSJNOmoPwc6Yk8qY8sunQ7 peKaH4XFOVgULNbadxaXgBlEZvKxduFs8iUZVnVHddov5dYHkg0y/1zB/3X2AicPG2s51ZC 9BAA== X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Mon, 8 May 2017 18:35:35 +0800 Message-Id: <20170508103535.23667-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.13.0.rc2 X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH] avformat/hlsenc: fix memleak 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" fix memleak bug, when all the process is normal, just free old_filename Signed-off-by: Steven Liu --- libavformat/hlsenc.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 221089c..d62d5b8 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1559,6 +1559,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) av_free(old_filename); return ret; } + + av_free(old_filename); } ret = ff_write_chained(oc, stream_index, pkt, s, 0);