Re: realloc potential memory leak?

Brandon Long <[email protected]>
Newsgroups gmane.text.clearsilver.general
Organization Fiction L Networks
Message-ID <20070730223603.GA3916@bl1>
Yes, that would be a memory leak if the realloc fails.  Its also not the
only case of this in the code.  If people think its worth fixing, ok.

Brandon

On 07/30/07 raphael.huck uttered the following other thing:
> Line 164 of 'cgi/html.c', there is:
> 
> parts = (struct _parts *) realloc (parts, sizeof(struct _parts) * 
> part_count);
> 
> Couldn't this be a potential memory leak in case 'realloc' fails and 
> returns 'NULL'? Then the reference to 'parts' will be lost, resulting 
> in a memory leak.
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 

-- 
    Scorpius: "There are vast regions of your brain which are filled 
               with nothing but gibberish."
    Chricton: "That would be high school."
                                     http://www.fiction.net/blong/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.