]> git.sesse.net Git - vlc/commitdiff
* src/misc/net.c: fixed segfault.
authorGildas Bazin <gbazin@videolan.org>
Mon, 22 Aug 2005 21:31:51 +0000 (21:31 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 22 Aug 2005 21:31:51 +0000 (21:31 +0000)
src/misc/net.c

index 3368ffc4e1ebc3684250dac9cecaeb15a6b69b67..f2750fe8a04454f5909a1e38a9ac22007de4af8f 100644 (file)
@@ -511,6 +511,9 @@ int __net_OpenUDP( vlc_object_t *p_this, const char *psz_bind, int i_bind,
     network_socket_t sock;
     module_t         *p_network = NULL;
 
+    if( psz_server == NULL ) psz_server = "";
+    if( psz_bind == NULL ) psz_bind = "";
+
     /* Prepare the network_socket_t structure */
     sock.psz_bind_addr   = psz_bind;
     sock.i_bind_port     = i_bind;
@@ -520,11 +523,6 @@ int __net_OpenUDP( vlc_object_t *p_this, const char *psz_bind, int i_bind,
     sock.v6only          = 0;
     sock.i_handle        = -1;
 
-    if( psz_server == NULL )
-        psz_server = "";
-    if( psz_bind == NULL )
-        psz_bind = "";
-
     msg_Dbg( p_this, "net: connecting to '[%s]:%d@[%s]:%d'",
              psz_server, i_server, psz_bind, i_bind );