[vlc-commits] fingerprinter: fix incorrect error cleanup

Francois Cartegnie git at videolan.org
Sun Jul 24 22:38:04 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Jul 24 21:26:17 2016 +0200| [ba0d3f1a26832535eacfed5c74bef517caa639e7] | committer: Francois Cartegnie

fingerprinter: fix incorrect error cleanup

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

 modules/misc/fingerprinter.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/misc/fingerprinter.c b/modules/misc/fingerprinter.c
index 043331e..6cacbc0 100644
--- a/modules/misc/fingerprinter.c
+++ b/modules/misc/fingerprinter.c
@@ -217,7 +217,7 @@ static int Open(vlc_object_t *p_this)
     return VLC_SUCCESS;
 
 error:
-    free( p_sys );
+    Close( p_this );
     return VLC_EGENERIC;
 }
 
@@ -229,8 +229,11 @@ static void Close(vlc_object_t *p_this)
     fingerprinter_thread_t   *p_fingerprinter = (fingerprinter_thread_t*) p_this;
     fingerprinter_sys_t *p_sys = p_fingerprinter->p_sys;
 
-    vlc_cancel( p_sys->thread );
-    vlc_join( p_sys->thread, NULL );
+    if( p_sys->thread )
+    {
+        vlc_cancel( p_sys->thread );
+        vlc_join( p_sys->thread, NULL );
+    }
 
     for ( int i = 0; i < vlc_array_count( p_sys->incoming.queue ); i++ )
         fingerprint_request_Delete( vlc_array_item_at_index( p_sys->incoming.queue, i ) );



More information about the vlc-commits mailing list