[vlc-commits] access: fix NULL deref on error
Rémi Denis-Courmont
git at videolan.org
Thu Oct 22 21:45:24 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 22 21:16:06 2015 +0300| [5a54270ebe0d310ada2d6b7449e0caf8d721932a] | committer: Rémi Denis-Courmont
access: fix NULL deref on error
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5a54270ebe0d310ada2d6b7449e0caf8d721932a
---
src/input/access.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/input/access.c b/src/input/access.c
index 18b8357..70441bd 100644
--- a/src/input/access.c
+++ b/src/input/access.c
@@ -65,10 +65,13 @@ static access_t *access_New(vlc_object_t *parent, input_thread_t *input,
return NULL;
access_t *access = vlc_custom_create(parent, sizeof (*access), "access");
+ if (unlikely(access == NULL))
+ return NULL;
+
char *scheme = strndup(mrl, p - mrl);
char *url = strdup(mrl);
- if (unlikely(access == NULL || scheme == NULL || url == NULL))
+ if (unlikely(scheme == NULL || url == NULL))
{
free(url);
free(scheme);
More information about the vlc-commits
mailing list