From patchwork Sat Sep 19 16:35:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22485 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 A5F5844A83E for ; Sat, 19 Sep 2020 19:37:23 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 92C6568B73E; Sat, 19 Sep 2020 19:37:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3921968B6F7 for ; Sat, 19 Sep 2020 19:37:15 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id s13so8098634wmh.4 for ; Sat, 19 Sep 2020 09:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a1zwyb6W1nUWUEqA+0xYfGzVyMKuo5JvmmMh9QOf6+k=; b=BmQOG752OMSD47bMg8z3N85M4PLPdvdxpDiCNzXs18NLgJlrVQWe1/9AxZLNk49sLN jyCAQXO18VKkso3kNbjcIRv0lWbmOK+rw8FlFp7Phf7N5cPv1yyaScFl2S4pkEUsyvyQ QGUdIKhAklpw8y139V7BvR3TYb/VWPjAB6KkRBvsxtqUWTeTMMNjjMBzDEr8d2H0Sd4c tbVYoyUdoAZ8HJZ/QjNSoGyjmYqOIG+dpEgqNUEG/pyGObisj2+MqbSkf+AtXJO6YfV9 y3KwDS91rKemQcpAhPIFrZeEXuZPR+LNzpn+e/8kR5GFZowqbStyKJY6x0ArLQ8dEFHD 8TWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a1zwyb6W1nUWUEqA+0xYfGzVyMKuo5JvmmMh9QOf6+k=; b=eBIGpVoRuUpOjZ3uSi+1Oy1JA9HvRB9YIRtLxDoKiWcS3gVlyj7WHO09SlEPfoJIdc tEHAUUt21K8EIunt6H50h2pEU3it3r8FWiIttlcTwJPPklB4bonALYYypmkjrUKlz/66 e25KDRuFdcbkBiwHfTju0gtodBX/NKFwPbv6M01vAMElHligA4DMyKSVcJZIZxJcw93x Nhf6Jv87hfojSpDyLftnztaclObr/h4041ZJIYOoAT/uqUgP7RJHBoQlrlvBc9kSUogC 7+f5jWLFdPP3S9GtnvFvd4OwBwgqY/p9bPSm3AGfbFyViiNAaDtc8RAvCCHFo4KqI+yG Dseg== X-Gm-Message-State: AOAM533zh63P/L3tLFG0sXE5CT4TKrgOqHxN2+bjVvtjAHiZftTASqfY KNXh1CfmYMQpRgale0r1tHpAgolu/ok= X-Google-Smtp-Source: ABdhPJzO+qn9lL1Z2Dv4bQyN7X8N42Wxw4jJumukvNgJDSyGlxGqNQP43REoRL/GFK3v+6OTcIOVGw== X-Received: by 2002:a1c:f612:: with SMTP id w18mr20808092wmc.47.1600533434349; Sat, 19 Sep 2020 09:37:14 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1fb0f.dynamic.kabel-deutschland.de. [188.193.251.15]) by smtp.gmail.com with ESMTPSA id d5sm12451137wrb.28.2020.09.19.09.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 09:37:13 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 19 Sep 2020 18:35:52 +0200 Message-Id: <20200919163610.1099233-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200919163610.1099233-1-andreas.rheinhardt@gmail.com> References: <20200919163610.1099233-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/21] avformat/dashdec: Don't leave representation in inconsistent state on error 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This currently doesn't cause any trouble, because the only caller did not clean up the representation upon error at all; but fixing this is a prerequisite for doing so. Signed-off-by: Andreas Rheinhardt --- libavformat/dashdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index f81b323d96..d84da16dbd 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -627,7 +627,7 @@ static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representati initialization_val); if (!rep->init_section->url) { - av_free(rep->init_section); + av_freep(&rep->init_section); xmlFree(initialization_val); xmlFree(range_val); return AVERROR(ENOMEM);