[Libguestfs] [PATCH 0/2] Fix (minor) bugs found by Clang static analyzer

Peter Wu peter at lekensteyn.nl
Fri Aug 8 09:31:07 UTC 2014


Hi,

Here are more fixes for bugs caught my Clang static analyzer. Two bugs are
remaining, namely a memleak in the perl bindings. I am not an expert in that
area and did not manage to fix it in a correct way, so I will just describe it.

The ASetValues and ASetValue functions call a function which allocates memory.
The generated code puts this before PREINIT. Then there is the typemap for
hive_h object. This code can return if the validation fails which causes a
memleak.

So, could some Perl programmer pick this up?

Peter Wu (2):
  Silence dead assigmnents/initialization/increments
  Avoid calling calloc(0, x)

 lib/write.c  | 12 +++++-------
 sh/hivexsh.c |  4 ++++
 2 files changed, 9 insertions(+), 7 deletions(-)

-- 
2.0.2

PS. now I'll have a look at the Python bug wrt set_value.




More information about the Libguestfs mailing list