From 14f9e47314ab70a2c786cb040ca0ca2fc1a0e163 Mon Sep 17 00:00:00 2001 From: LuMingYin Date: Sat, 13 Apr 2024 12:20:11 +0800 Subject: [PATCH] libavformat/rtsp: fix a memory leak on error path Signed-off-by: LuMingYin Signed-off-by: Zhao Zhili --- 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++) {