]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix crash in virsh after bogus command
authorChris Lalancette <clalance@redhat.com>
Fri, 12 Mar 2010 11:00:46 +0000 (12:00 +0100)
committerDaniel Veillard <veillard@redhat.com>
Fri, 12 Mar 2010 11:00:46 +0000 (12:00 +0100)
commit3ebbc241a1052eea18bd1fb97325f5ba996b974d
tree09b1814c6e94e7b45fb95c937be81b3ee4e0418b
parentbe2a53e6e09dc3654f48907dda57b048bf029a0e
Fix crash in virsh after bogus command

If you ran virsh in interactive mode and ran a command
that virsh could not parse, it would then SEGV
on subsequent commands.  The problem is that we are
freeing the vshCmd structure in the syntaxError label
at the end of vshCommandParse, but forgetting to
set ctl->cmd to NULL.  This means that on the next command,
we would try to free the same structure again, leading
to badness.

* tools/virsh.c: Make sure to set ctl->cmd to NULL after
  freeing it in vshCommandParse()
tools/virsh.c