[libvirt] Coverity update

John Ferlan jferlan at redhat.com
Fri Jan 18 15:46:22 UTC 2013


Taking Eric's suggestion from:

https://www.redhat.com/archives/libvir-list/2013-January/msg01050.html

There's two changes that have yet to be reviewed:

https://www.redhat.com/archives/libvir-list/2013-January/msg00537.html
https://www.redhat.com/archives/libvir-list/2013-January/msg00541.html

After this recent set of 10 patches there are about 20 patches
remaining. With the 2 above and the 10 from yesterday, the coverity
defect list stands at 236 (down from 297). Of those, about 50 are
related to a sdt.h macro issue, 50 are false positives requiring a
comment change, and another 95 can be fixed/resolved by a very simple
(but yet unnecessary) change to src/esx/esx_vi.c and
src/esx/esx_vi_types.c. Each module as a __TEMPLATE__FREE() macro which
does the following:

        item=*ptrptr;        \
                             \
        _body                \
                             \
        VIR_FREE(*ptrptr);   \

Coverity has a hard time with the VIR_FREE(*ptrptr) here and in other
modules, thus it decides we must be leaking. No amount of tagging
completely removes all the warnings (I tried adding them everywhere and
only reduced the count, not eliminated). There is a solution, but I
really don't like it.  If the VIR_FREE(*ptrptr) is changed to:

        VIR_FREE(item);      \
        *ptrptr = NULL;      \

Coverity is happy. I asked about this on a Coverity community message
board, but no one has an answer. I even generated a small program which
replicated the issue. In a way I think it could be a Coverity bug, but
I'm not sure I want to make that claim yet.

John




More information about the libvir-list mailing list