On Mon, 25 Oct 2010 10:13:26 -0200 Lucas De Marchi
<[email protected]> said:

> Hi all,
> 
> Find attached a file with a report of wrong usage of realloc.
> Basically, if you do "a = realloc(a, ...)" and realloc fails, you lost
> the previous pointer and then you cannot free that var anymore. There
> can be some false positives, in case you previously assigned the
> pointer to a tmp var instead of using the tmp var in the call to
> realloc.
> 
> 
> Note: this was obtained by realloc-spot-lost-pointer.cocci script in
> svn. It uses the syntax of a patch, but the "-" in the beginning of a
> line is there only to spot the callers... it's not a "-" as usually
> intended in patches.

thanks. while true - realloc will fail when we run out of memory.. and at that
point even if we catch it and deal with it... we will fail the call and this
will cascade. every eina_list_append() will fail too but nothing will catch it
and so on. it gets pretty nasty once u run out of memory to handle it. :)

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    [email protected]


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to