From patchwork Wed Oct 9 07:35:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 15590 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 97E4C447223 for ; Wed, 9 Oct 2019 10:36:05 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 84AF26881C4; Wed, 9 Oct 2019 10:36:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A9A956881B2 for ; Wed, 9 Oct 2019 10:35:57 +0300 (EEST) X-QQ-mid: bizesmtp23t1570606548tg4dcg0s Received: from localhost (unknown [47.90.47.25]) by esmtp10.qq.com (ESMTP) with id ; Wed, 09 Oct 2019 15:35:47 +0800 (CST) X-QQ-SSF: 01100000002000K0ZRF1000A0000000 X-QQ-FEAT: hvOMzb1rsI3xYzG7cEOSM+tT8P/34pR4MSeruJCZLYZUiOWUhml8ICro5z7o1 d8syf81m4FumKxUu925bgUeeFx1eHhP4dMFm23fCnBCOq0ueteKDhnomJ4UAXjUsbQQZ0C8 onU2OcQlc208jd7ByJ21p/qcztX/rxZtXvSPenghuxmPLWKz4ZHOaolUVPmrb/hLuluCORJ AFxREcf+4f/ROtuoWPMN6xUrs2igLffSQVrS8d3jzZEraYaa+jclt6Haa91X4kRstvPGzgr kwi+u8OsOJzrEpDvIjDU0hl7IeZDdhzpS581Xsipuni6C01sNZzcWWtlqHGmptlDE8wrhEM h/ndwU5 X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Wed, 9 Oct 2019 15:35:27 +0800 Message-Id: <20191009073530.4505-8-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:qybgforeign2 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v1 08/11] avformat/rtmpproto: fix memleak when open rtmp failed 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/rtmpproto.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index eb08d4d424..ae5eef8bca 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2880,6 +2880,12 @@ reconnect: return 0; fail: + if (rt->playpath) + av_free(rt->playpath); + if (rt->tcurl) + av_free(rt->tcurl); + if (rt->flashver) + av_free(rt->flashver); av_dict_free(opts); rtmp_close(s); return ret;