[vlc-commits] lua: PushCommand: Check for allocation failure

Hugo Beauzée-Luyssen git at videolan.org
Thu Mar 30 13:56:32 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Mar 28 16:04:05 2017 +0200| [123e190ee303a4bd9e3efb295b4830651c062fec] | committer: Hugo Beauzée-Luyssen

lua: PushCommand: Check for allocation failure

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

 modules/lua/extension_thread.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/lua/extension_thread.c b/modules/lua/extension_thread.c
index f3e9ca9..751070c 100644
--- a/modules/lua/extension_thread.c
+++ b/modules/lua/extension_thread.c
@@ -230,6 +230,8 @@ int PushCommand__( extension_t *p_ext,  bool b_unique, command_type_e i_command,
 {
     /* Create command */
     struct command_t *cmd = calloc( 1, sizeof( struct command_t ) );
+    if( unlikely( cmd == NULL ) )
+        return VLC_ENOMEM;
     cmd->i_command = i_command;
     switch( i_command )
     {



More information about the vlc-commits mailing list