Alan Coopersmith writes:
> For instance, while I know Coverity, and I'm sure others of these,
> find resource leaks in which malloc is called without a free, or
> open without a close, I don't know if any know that XCreatePixmap
> may only return an int to the X client, but it's caused memory
> allocation to happen on the server and XFreePixmap is needed to
> avoid leaks there.

Coverity can handle this.  You can specify that particular functions
are resource allocators/deallocators using their extension language,
and the generic static leak analysis will proceed from there.

It comes with automatic ones for the usual suspects (malloc/free), but
domain specific ones are either a separate library or a roll-your-own
affair.

In general, though, for non-trivial applications, you have to do this
sort of groundwork on your own before the tool becomes fully
functional.  You have to let the tool know about some of your local
semantics so that it can properly analyze the usage.

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to