From patchwork Sat Apr 13 04:20:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LuMingYin X-Patchwork-Id: 48038 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:670b:b0:1a9:af23:56c1 with SMTP id wh11csp661153pzb; Fri, 12 Apr 2024 21:20:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXtazLoX7GEqwZzovYN+9ukp80pLHB0D+hJgEav/7Tngch4dVosWVGrhIEjJyvVaCNhIQ8tiiI+EhgHb7CVe8KHp3n3cgaoWOc+TA== X-Google-Smtp-Source: AGHT+IHKD1LjSHiriNvk2gmX77KJyagFOcOKxlP4HMQObc6zU/gE/I7CAn0gETkkAPj4OjfDy1Ul X-Received: by 2002:ac2:42c5:0:b0:516:cc2f:41d4 with SMTP id n5-20020ac242c5000000b00516cc2f41d4mr3135718lfl.25.1712982029671; Fri, 12 Apr 2024 21:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712982029; cv=none; d=google.com; s=arc-20160816; b=dwVRoCPJT3CihUkwXP22fXuQ6kcb0znNMtAX380vcaplPEwTsw+Trh/gbOTH/+b5Ab KAEjd/IpsC9y+JJChowQj8ZqPNeczg6lTKY9lptfQmNeN3OLuJf43Jc3Z2gstYIAi8Z0 W7trSPLxRrTfTUSTK/KURkAE0cRw/Fy3H0BMPdpNCVVC++V83B9i4FhPgWNdQ7SJKptA MQIu136VheuSmyZjIN1iVs2Md9b6xb9gFDtBDEPprIaDPGF2a2HJ7QherhEpqWWfPWAU 2+/9DyfryKcMmoEb085NC+lngGwdM6mJRKg1Hc2n87mOnonN9NCm50epLm9QB+W7V5qB ayhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=NNWA3Y9E82YDC2XrjlEEQDV2v2J9WR73sE0GmF3mrOQ=; fh=h93Jk9zXtjyzsFd9PKvKbdVr/RKQn4bW7LGFE3/Lh8E=; b=wIyqF45/xn5Ahqm+PANRX+oW5kEXooDkXvbtEUADnH6veC6LRegJmKBQwo5NqCIJjd KuNq47IJi2rAnX3e6L3T8UGrhxPS5vXuIxGtqhoFLUoak9x53rpRKMX6KFE0+bcY3BLk w9kzQOaJFmwANzKeGpCWqVuynkBl/KZp3RQzDbWStM57tLKOuHW2xAZXnNIodF0/yM0/ hNZ7T8EIxfGPhhWFe2/9ghZZ5CIm7dLrQXf/XkoOPe+Ck1oKcMPANQA3X/C25Yd3WVdd dWua7Zr8TD0LVijQg1STQRt7Jme4faEyWuIFde98/2HgJp8hvPZXwqCFL5kVXw040cn7 4+gg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@163.com header.s=s110527 header.b=D6b9UHHS; 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=163.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id js1-20020a17090797c100b00a4e56907380si2451756ejc.770.2024.04.12.21.20.28; Fri, 12 Apr 2024 21:20:29 -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=@163.com header.s=s110527 header.b=D6b9UHHS; 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=163.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B604368D2EE; Sat, 13 Apr 2024 07:20:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.2]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6061B68D07E for ; Sat, 13 Apr 2024 07:20:18 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=k6sXG i9oZRfBCPBDm9HW5B0w3HqfmuBmuHGgZC1wBFo=; b=D6b9UHHS2yzU7mzzblVzy +3HmjjZu/YegDnZ7KlRKfAzu0ZVXHfZueH8kLcR+HXFR9BR6B1YDghTuZ8VjQRz+ Ho1qJwbKr/9dVSwG7hlfM6HY+LZJHSrCslIcY+jIdrxAyX+7jMlM2QjhP9AgXKCu R1Fh3kUmaQNkU+MOr9qkaU= Received: from localhost.localdomain (unknown [111.198.54.11]) by gzga-smtp-mta-g2-4 (Coremail) with SMTP id _____wDXv2v9Bxpmg2UcAA--.1929S2; Sat, 13 Apr 2024 12:20:14 +0800 (CST) From: LuMingYin To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Apr 2024 12:20:11 +0800 Message-Id: <20240413042011.1974778-1-lumingyindetect@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: _____wDXv2v9Bxpmg2UcAA--.1929S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jw17Zw4UWF45WFW7Ar1UJrb_yoW3WrX_KF 9FgF4UXrWYvFsxua45Cr45KFWUAa1xur93GF43Jry7Wa45ZF43ur1kWan3JrZ5JrsIyrnI krZ3KF13Wr129jkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_5rcPUUUUU== X-Originating-IP: [111.198.54.11] X-CM-SenderInfo: poxpx0hj1l0vphwhu3i6rwjhhfrp/1tbiKR+-92VOCdQv2AAAs- Subject: [FFmpeg-devel] [PATCH] libavformat/rtsp: fix a memory leak in libavformat/rtsp.c X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: lumingyindetect@163.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: rGty8DKP7KFZ The pointer variable 'fds' allocates a block of dynamic memory in the function 'ffurl_get_multi_file_handle', and the dynamic memory pointed to by this pointer is not released on error paths. Signed-off-by: LuMingYin --- libavformat/rtsp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index b0c61ee00a..db78735c7a 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -2071,6 +2071,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, if (fdsnum != 2) { av_log(s, AV_LOG_ERROR, "Number of fds %d not supported\n", fdsnum); + av_freep(&fds); return AVERROR_INVALIDDATA; } for (fdsidx = 0; fdsidx < fdsnum; fdsidx++) {