From patchwork Sun Jun 11 14:05:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 3907 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.195 with SMTP id 186csp512149vsk; Sun, 11 Jun 2017 07:06:51 -0700 (PDT) X-Received: by 10.223.164.80 with SMTP id e16mr5133130wra.100.1497190011625; Sun, 11 Jun 2017 07:06:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497190011; cv=none; d=google.com; s=arc-20160816; b=jKa7wKVbUAunxPVq4amTeOgoFj2UFIjz8EiBWyBHV66bx7v7LL0ibAURisX1zU6I1S qQOIKq2Ga+DMkl6lQMeP7HdOTamcehlVkRPmLCruotOwxsSpenlk4skF03R9WMYiRJ/t GfiH+VJZdKfRw+V/wpCECWwGoKWbjnGTkHjwl5WaGLJu9577wfvYmrJro1aCZooMI0sY LFHd+I/dyoeik4nBf/HrdHCw0n92uejfSVnwhlgVB0wdxWRnFfXwwpATzttmg8QTuW4t fenmGko8s3051v4kjjH3Eb8M1w8toP+U0GZsDweAXAee73NmfDM2LuTJYbuDNiRq3dR8 14bQ== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=CNpsTl2D5nIdRuacHIiEeZSuS3BNfPKbKZuCxq8J18c=; b=lVJA+FLBK26cHaZuQ2K5aHml20KiN/RNQghIncJgJE6MMxmy/+GgQ31t6/zCPMHlqm 4JvzW/T6vhMEbRHNFk7e+theccj3xTHkb3zOACjAIuIVWaPu0jXUPLio6TqIaAkwebcv 1f658pFJbsyvgQMfmR+tMa8gb6HRwd8uGLsDCZtEo3RMC5EMsbPbPkfO28xm3xLSLvG3 1bJW9I6a0wBMrd/KtzeBdBworv7wIT9h0+BKVAmxjeGvuy1vQUGRfdFRkw3lbWUyWPF/ OtTROD/f3UnqUZUQ0NpIV+zdLG9goseBABPtCRHaAzUu+kMdJaexgwlLUSiSuxMvcADZ gPEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org; 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 h9si2755584wmf.100.2017.06.11.07.06.51; Sun, 11 Jun 2017 07:06: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; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org; 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 6E51B689E34; Sun, 11 Jun 2017 17:06:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [5.9.118.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 01328688262 for ; Sun, 11 Jun 2017 17:06:01 +0300 (EEST) Received: from localhost.localdomain (unknown [IPv6:2a02:8109:43f:959c:ba97:5aff:fe10:ec69]) by btbn.de (Postfix) with ESMTPSA id 2DBD06A519; Sun, 11 Jun 2017 16:06:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rothenpieler.org; s=mail; t=1497189963; bh=eR8Yay1gQn3IszMNO8ip9pHSEVx2kuGjF1xtvdOp1FA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JZNRLOT/szNwi9NhKZIQvdy7KEMwIDobpMySxdEcQc4DuBGGc2Qj4XVTEzWT4yXaq jVjYlIXRakxOz85txw/ckBBmXvgiuojz5RGyyiOfABVfgtYiabl0Rq5gXlMsE9w8Fs GdetXGht5zc5xsdJyfNaGnN/FXxjYLAQDHlLdKV8= From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Sun, 11 Jun 2017 16:05:47 +0200 Message-Id: <20170611140551.11844-5-timo@rothenpieler.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170611140551.11844-1-timo@rothenpieler.org> References: <20170611140551.11844-1-timo@rothenpieler.org> Subject: [FFmpeg-devel] [PATCH 05/11] avformat/pcmdec: fix memory leak 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: Timo Rothenpieler MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes CID 1396267 --- libavformat/pcmdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c index 3c7e8ac84b..d0ceea6fa9 100644 --- a/libavformat/pcmdec.c +++ b/libavformat/pcmdec.c @@ -68,6 +68,7 @@ static int pcm_read_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "Invalid sample_rate found in mime_type \"%s\"\n", mime_type); + av_freep(&mime_type); return AVERROR_INVALIDDATA; } st->codecpar->sample_rate = rate; @@ -75,6 +76,7 @@ static int pcm_read_header(AVFormatContext *s) st->codecpar->channels = channels; } } + av_freep(&mime_type); st->codecpar->bits_per_coded_sample = av_get_bits_per_sample(st->codecpar->codec_id);