ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Thu Jan 20 20:18:11 2022 +0100| [61cbfdc0a29e88483a6fa9645f64fec71983689a] | 
committer: Andreas Rheinhardt

avformat/http: Fix double-free on error

av_dict_set() with AV_DICT_DONT_STRDUP_VAL takes ownership
of the string it is passed to as val; this includes freeing it
on error.

Fixes Coverity issue #1497468.

Reviewed-by: Eran Kornblau <eran.kornb...@kaltura.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=61cbfdc0a29e88483a6fa9645f64fec71983689a
---

 libavformat/http.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index e8096e3134..8f39d11a88 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -333,10 +333,8 @@ static int redirect_cache_set(HTTPContext *s, const char 
*source, const char *de
     }
 
     ret = av_dict_set(&s->redirect_cache, source, value, AV_DICT_MATCH_CASE | 
AV_DICT_DONT_STRDUP_VAL);
-    if (ret < 0) {
-        av_free(value);
+    if (ret < 0)
         return ret;
-    }
 
     return 0;
 }

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to