]> git.sesse.net Git - vlc/blobdiff - modules/services_discovery/bonjour.c
Services discoveries: check memory allocation
[vlc] / modules / services_discovery / bonjour.c
index be56e325c5118f165aa5f5d29a5887913f7fcccb..482809ac5b8ed4409ea4bf5ca3e81baafb3c9d02 100644 (file)
@@ -270,11 +270,9 @@ static int Open( vlc_object_t *p_this )
 
     p_sd->p_sys = p_sys = (services_discovery_sys_t *)malloc(
         sizeof( services_discovery_sys_t ) );
-    if( p_sd->p_sys == NULL )
-    {
-        msg_Err( p_sd, "out of memory" );
-        return VLC_EGENERIC;
-    }
+
+    if( !p_sys )
+        return VLC_ENOMEM;
 
     memset( p_sys, 0, sizeof(*p_sys) );