Re: Memory leak in attribute.c

Michał Kowalczuk <[email protected]> Wed, 4 Jan 2006 20:55:27 +0100
Newsgroups gmane.comp.video.graphicsmagick.bugs
Organization Drużyna Pingwina
Message-ID <[email protected]>
On 2006-01-04, Bob Friesenhahn <[email protected]> wrote:

>> I found a memory leak in magick/attribute.c, in function
>> GenerateEXIFAttribute(). There is an allocation of a string:
>> final=AllocateString("");
>> but when function returns with False it is never freed.
>> Here's a quick fix for that problem (the patch is for yesterday snapshot):
>
> Thanks for the report.  The fix is almost as gross as the code.  Maybe 
> a better approach is to use a 'goto' statement.  Certainly 'goto' is 
> frowned on, but in this case it seems to make sense.  There is also 
> the possiblity of adding an error-reporting macro which also releases 
> any resources.  But I like the goto.

OK, should I make another patch with 'goto' statement or will you fix it?

-- 
 _  <= Michał Kowalczuk => <==== (http://)|(mailto:sammael@)sammael.pl/? ====>
( ` <= GG#2113900 => <===== who | grep -i brunette | date; cd ~; ============>
 \  /||\ /||\ /||\ |~~| <==== unzip; strip; touch; finger; mount; fsck; =====>
,_)/~|| ` || ` ||~\|~_|_   <== more; yes; fsck; fsck; fsck; umount; sleep ===>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click