[vlc-devel] [V3 09/13] input: Fix missing mutex unlock on error path

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Nov 18 15:23:55 CET 2020


---
 src/input/input.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/input/input.c b/src/input/input.c
index e6a1e4a874..06b18e2f5c 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -3474,7 +3474,10 @@ int input_GetAttachments(input_thread_t *input,
 
     *attachments = vlc_alloc(attachments_count, sizeof(input_attachment_t*));
     if (!*attachments)
+    {
+        vlc_mutex_unlock(&priv->p_item->lock);
         return -1;
+    }
 
     for (int i = 0; i < attachments_count; i++)
         (*attachments)[i] = vlc_input_attachment_Hold(priv->attachment[i]);
-- 
2.29.2



More information about the vlc-devel mailing list