threads: fix leaks on error path
authorPierre Ynard <linkfanel@yahoo.fr>
Thu, 13 Aug 2009 11:12:34 +0000 (13:12 +0200)
committerPierre Ynard <linkfanel@yahoo.fr>
Thu, 13 Aug 2009 11:12:34 +0000 (13:12 +0200)
Fix memleak + event leak on wince if thread creation fails

src/misc/w32thread.c

index 8f04a3d..7e2611f 100644 (file)
@@ -480,6 +480,11 @@ int vlc_clone (vlc_thread_t *p_handle, void * (*entry) (void *), void *data,
             SetThreadPriority (hThread, priority);
         return 0;
     }
             SetThreadPriority (hThread, priority);
         return 0;
     }
+
+#ifdef UNDER_CE
+    CloseHandle (th->cancel_event);
+#endif
+    free (entry_data);
     return errno;
 }
 
     return errno;
 }