[vlc-commits] input: Add missing allocation error check

Hugo Beauzée-Luyssen git at videolan.org
Mon Feb 11 16:07:02 CET 2019


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Feb  7 17:22:12 2019 +0100| [ac316d119fba17515643cea5235268d0bfe68732] | committer: Hugo Beauzée-Luyssen

input: Add missing allocation error check

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

 src/input/access.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/input/access.c b/src/input/access.c
index 481405bff0..b4f1531ff6 100644
--- a/src/input/access.c
+++ b/src/input/access.c
@@ -313,6 +313,12 @@ stream_t *stream_AccessNew(vlc_object_t *parent, input_thread_t *input,
 
         s->p_input_item = input ? input_GetItem(input) : NULL;
         s->psz_url = strdup(access->psz_url);
+        if (unlikely(s->psz_url == NULL))
+        {
+            vlc_object_release(s);
+            vlc_stream_Delete(access);
+            return NULL;
+        }
 
         if (access->pf_block != NULL)
             s->pf_block = AStreamReadBlock;



More information about the vlc-commits mailing list