Commit f69f8352 authored by Rémi Duraffort's avatar Rémi Duraffort

Fix potential use-after-free (cid #1047503)

psz_realhost is an alias to psz_socks when using socks.
parent dea05a9d
...@@ -138,14 +138,15 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port, ...@@ -138,14 +138,15 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
}, *res; }, *res;
int val = vlc_getaddrinfo (psz_realhost, i_realport, &hints, &res); int val = vlc_getaddrinfo (psz_realhost, i_realport, &hints, &res);
free( psz_socks );
if (val) if (val)
{ {
msg_Err (p_this, "cannot resolve %s port %d : %s", psz_realhost, msg_Err (p_this, "cannot resolve %s port %d : %s", psz_realhost,
i_realport, gai_strerror (val)); i_realport, gai_strerror (val));
free( psz_socks );
return -1; return -1;
} }
free( psz_socks );
int timeout = var_InheritInteger (p_this, "ipv4-timeout"); int timeout = var_InheritInteger (p_this, "ipv4-timeout");
if (timeout < 0) if (timeout < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment