[vlc-devel] [PATCH 2/2] strings: vlc_xml_encode: fix error-path

Filip Roséen filip at atch.se
Sat Feb 25 09:26:56 CET 2017


This patch is now obsolete as *Rémi* pushed an equivalent patch of his
own.

 - http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1dcc288e75e1463e45080f45305f62d417fa24e

On 2017-02-24 21:32, Filip Roséen wrote:

> The resource should only be freed if vlc_memstream_close was
> successful, as only then do we have ownership of what stream.ptr
> refers to.
> ---
>  src/text/strings.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/text/strings.c b/src/text/strings.c
> index 6daad07c68..7adfbcd95e 100644
> --- a/src/text/strings.c
> +++ b/src/text/strings.c
> @@ -297,7 +297,7 @@ char *vlc_xml_encode (const char *str)
>      {
>          if (unlikely(n == (size_t)-1))
>          {
> -            if (vlc_memstream_close(&stream))
> +            if (vlc_memstream_close(&stream) == 0)
>                  free(stream.ptr);
>              errno = EILSEQ;
>              return NULL;
> -- 
> 2.11.1
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170225/c65ade36/attachment.html>


More information about the vlc-devel mailing list