<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 9: memory leak</title><link>https://sourceforge.net/p/dvbtools/bugs/9/</link><description>Recent changes to 9: memory leak</description><atom:link href="https://sourceforge.net/p/dvbtools/bugs/9/feed.rss" rel="self"/><language>en</language><lastBuildDate>Fri, 23 Oct 2009 23:43:30 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/dvbtools/bugs/9/feed.rss" rel="self" type="application/rss+xml"/><item><title>memory leak</title><link>https://sourceforge.net/p/dvbtools/bugs/9/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;We've received the following report from a reporter:&lt;br /&gt;
---&lt;br /&gt;
I just had a look at factory package dvbstream-0.6-139.10&lt;br /&gt;
source code file dvbstream-cvs/mpegtools/ctools.c&lt;br /&gt;
function read_pes&lt;/p&gt;
&lt;p&gt;I notice the following code&lt;/p&gt;
&lt;p&gt;buf = (u8 *) malloc(p-&amp;gt;length);&lt;br /&gt;
if((neof = read(f,buf,p-&amp;gt;length))&amp;lt; p-&amp;gt;length) return -1;&lt;/p&gt;
&lt;p&gt;so if the return is taken, then buf is a memory leak.&lt;br /&gt;
Suggest new code&lt;/p&gt;
&lt;p&gt;buf = (u8 *) malloc(p-&amp;gt;length);&lt;br /&gt;
if((neof = read(f,buf,p-&amp;gt;length))&amp;lt; p-&amp;gt;length)&lt;br /&gt;
{&lt;br /&gt;
free( buf);&lt;br /&gt;
return -1;&lt;br /&gt;
}&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Pavol Rusnak</dc:creator><pubDate>Fri, 23 Oct 2009 23:43:30 -0000</pubDate><guid>https://sourceforge.netea876da128249ce6f4a7d02e496edb2f8ac9d1aa</guid></item></channel></rss>