diff mbox series

[FFmpeg-devel] avformat/dashdec: Reset pointer to NULL after freeing it

Message ID 20201008134258.13551-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 616eb93a404c088635be74498ddb04072dfe1b90
Headers show
Series [FFmpeg-devel] avformat/dashdec: Reset pointer to NULL after freeing it | expand

Checks

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

Commit Message

Andreas Rheinhardt Oct. 8, 2020, 1:42 p.m. UTC
This is currently safe here, because the effective lifetime of
adaptionset_lang is parse_manifest_adaptationset() (i.e. the pointer
gets overwritten each time on entry to the function and gets freed
before exiting the function), but it is nevertheless safer to reset the
pointer.

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

Patch

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 42ea74635b..c28bb07f44 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1146,6 +1146,7 @@  static int parse_manifest_adaptationset(AVFormatContext *s, const char *url,
 
 err:
     xmlFree(c->adaptionset_lang);
+    c->adaptionset_lang = NULL;
     return ret;
 }