]> git.sesse.net Git - vlc/commitdiff
sout_description: missing check in initialization
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 16 Feb 2015 17:43:46 +0000 (19:43 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 16 Feb 2015 17:46:33 +0000 (19:46 +0200)
modules/stream_out/description.c

index 05f76ced765cea6b587b0e503c7f653e8aa043df..71959c27a632c9fb9600a32eb2449a295ec0c48a 100644 (file)
@@ -73,12 +73,14 @@ struct sout_stream_id_sys_t
 static int Open( vlc_object_t *p_this )
 {
     sout_stream_t *p_stream = (sout_stream_t*)p_this;
-    sout_stream_sys_t *p_sys;
+    sout_stream_sys_t *p_sys = malloc(sizeof(sout_stream_sys_t));
+    if( unlikely(p_sys == NULL) )
+        return VLC_ENOMEM;
 
     p_stream->pf_add  = Add;
     p_stream->pf_del  = Del;
     p_stream->pf_send = Send;
-    p_sys = p_stream->p_sys = malloc(sizeof(sout_stream_sys_t));
+    p_stream->p_sys = p_sys;
 
     p_sys->data = var_InheritAddress(p_stream, "sout-description-data");
     if (p_sys->data == NULL)