[vlc-devel] [PATCH] vlccore: os2: fix memory leak of freeaddrinfo()
Rémi Denis-Courmont
remi at remlab.net
Fri Nov 14 09:09:34 CET 2014
Le 2014-11-14 06:00, KO Myung-Hun a écrit :
> ---
> src/os2/getaddrinfo.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/os2/getaddrinfo.c b/src/os2/getaddrinfo.c
> index 1a3f8a4..b220fc1 100644
> --- a/src/os2/getaddrinfo.c
> +++ b/src/os2/getaddrinfo.c
> @@ -157,9 +157,11 @@ void freeaddrinfo (struct addrinfo *res)
> {
> if (res == NULL)
> return;
> +
> + freeaddrinfo (res->ai_next);
> +
> free (res->ai_canonname);
> free (res->ai_addr);
> - free (res->ai_next);
> free (res);
> }
This calls for a while loop.
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list