<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 5: IptcLog memory leak - solution included</title><link href="https://sourceforge.net/p/libiptcdata/bugs/5/" rel="alternate"/><link href="https://sourceforge.net/p/libiptcdata/bugs/5/feed.atom" rel="self"/><id>https://sourceforge.net/p/libiptcdata/bugs/5/</id><updated>2009-08-08T21:02:38Z</updated><subtitle>Recent changes to 5: IptcLog memory leak - solution included</subtitle><entry><title>IptcLog memory leak - solution included</title><link href="https://sourceforge.net/p/libiptcdata/bugs/5/" rel="alternate"/><published>2009-08-08T21:02:38Z</published><updated>2009-08-08T21:02:38Z</updated><author><name>Justin</name><uri>https://sourceforge.net/u/metal450/</uri></author><id>https://sourceforge.netaf8982299aadea4cbb3b1b6a918198eca2063e44</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The following sequence of code leaks memory:&lt;/p&gt;
&lt;p&gt;IptcLog* iptcLog = iptc_log_new();&lt;br /&gt;
iptc_log_free( iptcLog );&lt;/p&gt;
&lt;p&gt;The problem is that iptc_log_free() does not release log-&amp;gt;mem - only the IptcLog itself.  This can be resolved by changing iptc_log_free() to:&lt;/p&gt;
&lt;p&gt;void&lt;br /&gt;
iptc_log_free (IptcLog *log)&lt;br /&gt;
{&lt;br /&gt;
if (!log) return;&lt;br /&gt;
{&lt;br /&gt;
IptcMem *mem = log-&amp;gt;mem;&lt;br /&gt;
iptc_mem_free (log-&amp;gt;mem, log);&lt;br /&gt;
iptc_mem_unref (mem);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>