[vlc-devel] [RFC 13/38] access/bluray: replaced usage of xmalloc

Filip Roséen filip at videolabs.io
Mon Jun 27 13:43:24 CEST 2016


---
 modules/access/bluray.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 8178617..e0cbfa1 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1944,7 +1944,11 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
             return VLC_EGENERIC;
 
         *pi_int = p_sys->i_attachments;
-        *ppp_attach = xmalloc(sizeof(input_attachment_t *) * p_sys->i_attachments);
+        *ppp_attach = malloc(sizeof(input_attachment_t *) * p_sys->i_attachments);
+
+        if( unlikely( !*ppp_attach ) )
+            return VLC_ENOMEM;
+
         for (int i = 0; i < p_sys->i_attachments; i++)
             (*ppp_attach)[i] = vlc_input_attachment_Duplicate(p_sys->attachments[i]);
         return VLC_SUCCESS;
-- 
2.9.0



More information about the vlc-devel mailing list