[vlc-devel] [PATCH] Fix gai_strerror on Unicode

Rémi Denis-Courmont remi at remlab.net
Sat Jan 30 15:42:17 CET 2016


Le 2016-01-30 10:26, Steve Lhomme a écrit :
> From: Jean-Baptiste Kempf <jb at videolan.org>
>
> ---
>  include/vlc_network.h | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/include/vlc_network.h b/include/vlc_network.h
> index 28a9fa6..bce3a2a 100644
> --- a/include/vlc_network.h
> +++ b/include/vlc_network.h
> @@ -199,7 +199,12 @@ VLC_API ssize_t net_vaPrintf( vlc_object_t
> *p_this, int fd, const char *psz_fmt,
>
>  #ifdef _WIN32
>  # undef gai_strerror
> -# define gai_strerror gai_strerrorA
> +# ifdef UNICODE
> +#   include <vlc_charset.h>
> +#   define gai_strerror(a) FromWide(gai_strerrorW)

Very obvious memory leak.

> +# else
> +#   define gai_strerror gai_strerrorA
> +# endif
>  #endif
>
>  #ifdef __OS2__

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list