From: Mike B. <mi...@ze...> - 2010-10-26 19:08:46
|
On Mon, 25 Oct 2010 10:13:26 -0200 Lucas De Marchi <luc...@pr...> wrote: > 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. > > > regards, > > Lucas De Marchi I feel like we went through something similar previously... -- Mike Blumenkrantz Zentific: Our boolean values are huge. |