[vlc-devel] [PATCH] input/input: properly release acquired entities on error

Filip Roséen filip at atch.se
Mon Feb 20 14:53:27 CET 2017


prematurely returning NULL will lead to acquired resources not to be
properly released, this fix makes sure that we use the error-label
what it is designed for.
---
 src/input/input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/input/input.c b/src/input/input.c
index 9eead35fb5..08a8abb0b7 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2355,7 +2355,7 @@ static demux_t *InputDemuxNew( input_thread_t *p_input, input_source_t *p_source
 
     /* handle anchors */
     if( InputStreamHandleAnchor( p_source, &p_stream, psz_anchor ) )
-        return NULL;
+        goto error;
 
     /* attach conditional record stream-filter */
     if( var_InheritBool( p_source, "input-record-native" ) )
-- 
2.11.1



More information about the vlc-devel mailing list