diff mbox series

[FFmpeg-devel,03/21] avformat/dashdec: Don't leave representation in inconsistent state on error

Message ID 20200919163610.1099233-3-andreas.rheinhardt@gmail.com
State Accepted
Commit 01a4c3596942dad396834fea155173590687c59d
Headers show
Series [FFmpeg-devel,01/21] avformat/dashdec: Avoid double free on error | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 19, 2020, 4:35 p.m. UTC
This currently doesn't cause any trouble, because the only caller did
not clean up the representation upon error at all; but fixing this is
a prerequisite for doing so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/dashdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index f81b323d96..d84da16dbd 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -627,7 +627,7 @@  static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representati
                                                      initialization_val);
 
             if (!rep->init_section->url) {
-                av_free(rep->init_section);
+                av_freep(&rep->init_section);
                 xmlFree(initialization_val);
                 xmlFree(range_val);
                 return AVERROR(ENOMEM);