From patchwork Sat Mar 11 23:33:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 2896 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.50.79 with SMTP id y76csp632124vsy; Sat, 11 Mar 2017 15:34:43 -0800 (PST) X-Received: by 10.28.135.82 with SMTP id j79mr4526012wmd.19.1489275283847; Sat, 11 Mar 2017 15:34:43 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r38si18706949wrb.121.2017.03.11.15.34.43; Sat, 11 Mar 2017 15:34:43 -0800 (PST) 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=@gmail.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B071D689A96; Sun, 12 Mar 2017 01:34:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2A8EC689A89 for ; Sun, 12 Mar 2017 01:34:11 +0200 (EET) Received: by mail-qk0-f194.google.com with SMTP id o135so33284095qke.2 for ; Sat, 11 Mar 2017 15:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=pzbDdDP7AGO6FQPHXWQ91IcvCIt6w7R2kUi8pNpr/I4=; b=pBe6T8G7G733ofDhzI0vdMlfOZWM8IRxUeKHzQ8cH80ak8FjDBe1pg9GkAj5O5W5ZZ 34lRn3TcphNaywvCe51KM/Q6j57RZexHVykduAyuVcz7V+Qz2uPC0I+vxpPjD39FfaxG P+jXuwRkeaZBhZFB6MdApSGWTcbf9Ppr6JIH77QLFRYVhbLay+X72nd06o/I6DqvV4Zv +fI3xleQGvexSgJV7eP48HSLT1xTHklpRAqDlKRYZ1wMWL0fkwn0bzGEGcjPOCYLs96H 4SvsXzwY0I2L9UkammiKeC02BMKba2I9ZE2rZttMfX9iwTTC1Jj9Q1VubS/iBE69xldo Wx0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=pzbDdDP7AGO6FQPHXWQ91IcvCIt6w7R2kUi8pNpr/I4=; b=oJUl6sLwQXdp65onSpR3rAx40xsFncfY4FwmQYvWh56yKxHJaGZkvLgxK7wI4vADYS NFRm99lfNVeIAP9aW6kjzurqsxCLMensijOyVGxJQdtqZCFKvthjAa1/kLWuD4xn0pU1 8dkZ8kDKqyg4E0s5K3UB2tN6xpsj3w8S1s2Soji0hryoLcd/zmQcxmYRTDHVLMhhTbO2 ZtdEuOPHv+BAsWepUO4Ik/jqze8rTqB3nxmbArVX2r10n4uIkSTcpT2O46vWk4qzx0fk 8ltP9doXmr67hOGv2eM+qMAzGZLtt3dUtV1V0voA/lq/o250hwRc/mTVSd27Ma+ofNIK 7neg== X-Gm-Message-State: AFeK/H1tilIv/YBWMDyWl2WmOspy6s5CacsR3Q+QRP5MOc70JNcIiX6ien4Z/8XSxw3+yA== X-Received: by 10.55.47.69 with SMTP id v66mr25107379qkh.222.1489275264667; Sat, 11 Mar 2017 15:34:24 -0800 (PST) Received: from localhost.localdomain ([181.231.62.139]) by smtp.gmail.com with ESMTPSA id v63sm9248896qkc.5.2017.03.11.15.34.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 11 Mar 2017 15:34:24 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 11 Mar 2017 20:33:53 -0300 Message-Id: <20170311233353.4836-2-jamrial@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170311233353.4836-1-jamrial@gmail.com> References: <20170311233353.4836-1-jamrial@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] tests/api-seek: fix memory leak on realloc() failure 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: James Almer --- tests/api/api-seek-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c index 6ef3b91933..503968fa13 100644 --- a/tests/api/api-seek-test.c +++ b/tests/api/api-seek-test.c @@ -40,8 +40,8 @@ static int add_crc_to_array(uint32_t crc, int64_t pts) if (size_of_array == 0) size_of_array = 10; size_of_array *= 2; - crc_array = av_realloc(crc_array, size_of_array * sizeof(uint32_t)); - pts_array = av_realloc(pts_array, size_of_array * sizeof(int64_t)); + crc_array = av_realloc_f(crc_array, size_of_array, sizeof(uint32_t)); + pts_array = av_realloc_f(pts_array, size_of_array, sizeof(int64_t)); if ((crc_array == NULL) || (pts_array == NULL)) { av_log(NULL, AV_LOG_ERROR, "Can't allocate array to store crcs\n"); return AVERROR(ENOMEM);