libavformat/rtsp: fix a memory leak on error path

Signed-off-by: LuMingYin <lumingyindetect@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
LuMingYin 2024-04-13 12:20:11 +08:00 committed by Zhao Zhili
parent 9481b7d932
commit 14f9e47314
1 changed files with 1 additions and 0 deletions

View File

@ -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++) {