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

Filip Roséen git at videolan.org
Tue Feb 21 09:56:18 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Mon Feb 20 14:53:27 2017 +0100| [e245cf39cbe6609449cd71359edea45b823327f2] | committer: Thomas Guillem

input/input: properly release acquired entities on error

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.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e245cf39cbe6609449cd71359edea45b823327f2
---

 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 9eead35..08a8abb 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" ) )



More information about the vlc-commits mailing list