]> xenbits.xensource.com Git - libvirt.git/commit
Fix possible memory leak in virsh-domain-monitor.c in cmdDomblklist
authorPavel Hrdina <phrdina@redhat.com>
Mon, 13 Jan 2014 14:42:35 +0000 (15:42 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 16 Jan 2014 13:47:02 +0000 (14:47 +0100)
commitbb22de2e3e91b22c8e9cb1c1be7da40163738138
treec7829d89b1390beeffb95f50ff8e94322aa108ef
parent362da8209d760fc1acd3a1c8df5b04aa676492eb
Fix possible memory leak in virsh-domain-monitor.c in cmdDomblklist

In a "for" loop there are created two new strings and they may not
be freed if a "target" string cannot be obtained. We have to free
the two created strings to prevent the memory leak.

This has been found by coverity.

John also pointed out that we should somehow care about the "type"
and "device" and Osier agreed to exit with error message if one of
them is set to NULL.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
tools/virsh-domain-monitor.c