]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vsh: Properly initialize res
authorJohn Ferlan <jferlan@redhat.com>
Mon, 18 Jul 2016 18:37:38 +0000 (14:37 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 19 Jul 2016 11:51:10 +0000 (07:51 -0400)
commitbd93ba64fdb899c2d581ab7506542f9663d21ffb
tree965dd31183b20ef5abafa657025d1d8cff17cb4f
parent7ca6cd7def2fbbd4308842cf4222fde7891d2987
vsh: Properly initialize res

The 'res' variable was only being initialized to NULL in the
if (!state) path; however, that path never used res and evenutally
res is assigned one of two results based on a pair of if then else if
conditions. If for some reason neither of those paths was taken and
the (!state) path wasn't taken, then 'res' would be indeterminate.

Found by Coverity, probably a false positive based on code paths, but
better safe than sorry for the future.

Signed-off-by: John Ferlan <jferlan@redhat.com>
tools/vsh.c