<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>This patch is now obsolete as <em>Rémi</em> pushed an equivalent patch of his own.</p>
<ul>
<li>http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1dcc288e75e1463e45080f45305f62d417fa24e</li>
</ul>
<p>On 2017-02-24 21:32, Filip Roséen wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> 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
</code></pre>
</blockquote>
</body>
</html>