[vlc-devel] [RFC 29/38] access_output/http: removed usage of xmalloc

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


---
 modules/access_output/http.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/access_output/http.c b/modules/access_output/http.c
index 0282894..cfc6428 100644
--- a/modules/access_output/http.c
+++ b/modules/access_output/http.c
@@ -288,8 +288,14 @@ static int Open( vlc_object_t *p_this )
 
     p_sys->i_header_allocated = 1024;
     p_sys->i_header_size      = 0;
-    p_sys->p_header           = xmalloc( p_sys->i_header_allocated );
     p_sys->b_header_complete  = false;
+    p_sys->p_header           = malloc( p_sys->i_header_allocated );
+
+    if( unlikely( !p_sys->p_header ) )
+    {
+        Close( p_sys );
+        return VLC_ENOMEM;
+    }
 
     p_access->pf_write       = Write;
     p_access->pf_seek        = Seek;
-- 
2.9.0



More information about the vlc-devel mailing list