[vlc-commits] sout_description: missing check in initialization

Rémi Denis-Courmont git at videolan.org
Mon Feb 16 18:47:54 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Feb 16 19:43:46 2015 +0200| [9e1965ad42f465e57b201b20da3463762e1eb447] | committer: Rémi Denis-Courmont

sout_description: missing check in initialization

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

 modules/stream_out/description.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/description.c b/modules/stream_out/description.c
index 05f76ce..71959c2 100644
--- a/modules/stream_out/description.c
+++ b/modules/stream_out/description.c
@@ -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)



More information about the vlc-commits mailing list