[PR] avformat/http: free cookie parameters on parse failure (PR #24177)

jiangjie via ffmpeg-devel <[email protected]>
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <[email protected]>
PR #24177 opened by jiangjie
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24177
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24177.patch

Fixes issue #24172




>From 6b9cc368f36125d40d921f33f09b7b69dc90c8ab Mon Sep 17 00:00:00 2001
From: jiangjie <[email protected]>
Date: Mon, 17 Aug 2026 18:05:43 +0800
Subject: [PATCH] avformat/http: free cookie parameters on parse failure

Fixes issue #24172
---
 libavformat/http.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 719d3c2ef5..69d4c8ab72 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1061,8 +1061,10 @@ static int parse_cookie(HTTPContext *s, const char *p, AVDictionary **cookies)
     char *name;
 
     // ensure the cookie is parsable
-    if (parse_set_cookie(p, &new_params))
+    if (parse_set_cookie(p, &new_params)) {
+        av_dict_free(&new_params);
         return -1;
+    }
 
     // if there is no cookie value there is nothing to parse
     cookie_entry = av_dict_iterate(new_params, NULL);
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.