Calls to realloc-type functions in Wine...

Juan Lang juan.lang at gmail.com
Sat Dec 22 09:59:27 CST 2007


Hi Lionel,

> It's very unlikely that *realloc fails, but if it does, this leaks some
> memory (or may fault, if the code is not protected against *realloc
> returning NULL).

Note that it's debatable what the best course of action here is.  It's
true that in case of failure, the original pointer should be freed.
But a fault might be acceptable too - if we're out of memory, what can
we possibly do to recover?  At least that's one line of reasoning.

> That prompted me to make a case-insensitive search of "realloc" in the
> whole Wine tree. Such a simple search was bound to turn a significant
> amount of noise (comments, TRACE/WARN, even correct uses of realloc,
> etc.), but it would also reveal other (probably) incorrect uses of
> realloc-type functions.

The results you sent aren't very useful without more investigation.
This might be a useful janitorial project, and might be better tracked
on the wiki than on this list.
--Juan



More information about the wine-devel mailing list