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.
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 withsome copious free time ;-)
Yeah, earlier this month I actually got as far as importing the whole of libvirt into CIL/Blast, 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.  http://et.redhat.com/~rjones/cil-analysis-of-libvirt/  http://hal.cs.berkeley.edu/cil/  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
Description: S/MIME Cryptographic Signature