[Libvir] PATCH Fix a couple of mem leaks

Richard W.M. Jones rjones at redhat.com
Tue Jul 31 09:02:32 UTC 2007


Daniel P. Berrange wrote:
> I ran 'make valgrind' for the first time in too long and found a hanful of
> memory leaks in code exercised by the test suite. The attached patch fixes
> them all.

+1

> I'm sure there are more lurking though - the test suite is mainly focused
> on exercising & validating correctness of parsing routines - its not really
> tried doing any validation of failure scenaarios. So I fear there's probably
> a number of error code paths where we don't cleanup properly, and/or don't
> reject invalid data. Its an area which should be addressed by someone with
> some copious free time ;-) 

Yeah, earlier this month I actually got as far as importing[0] the whole 
of libvirt into CIL[1]/Blast[2], which could analyse these sorts of bugs 
without either testing or spending too much time looking at code by 
hand.  (Think: Coverity, but free software).  Then work intervened. 
Given a week to make the tools work we could have regression tests which 
would analyse the code and find these problems automatically.

Rich.

[0] http://et.redhat.com/~rjones/cil-analysis-of-libvirt/
[1] http://hal.cs.berkeley.edu/cil/
[2] http://mtc.epfl.ch/software-tools/blast/

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070731/37779757/attachment-0001.bin>


More information about the libvir-list mailing list