[vlc-devel] [RFC 31/38] access/zip: replaced usage of xstrdup

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


---
 modules/access/zip/zipaccess.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/access/zip/zipaccess.c b/modules/access/zip/zipaccess.c
index 9655ce4..576ded3 100644
--- a/modules/access/zip/zipaccess.c
+++ b/modules/access/zip/zipaccess.c
@@ -113,7 +113,14 @@ int AccessOpen( vlc_object_t *p_this )
         return VLC_ENOMEM;
 
     /* Split the MRL */
-    psz_path = xstrdup( p_access->psz_location );
+    psz_path = strdup( p_access->psz_location );
+
+    if( unlikely( !psz_path ) )
+    {
+        free( p_sys );
+        return VLC_ENOMEM;
+    }
+
     psz_sep = strstr( psz_path, ZIP_SEP );
 
     *psz_sep = '\0';
-- 
2.9.0



More information about the vlc-devel mailing list