mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-13 08:56:09 -06:00
virsh: avoid double-free
* tools/virsh.c (vshCommandParse): Avoid double-free of "tkdata". Set it to NULL immediately after free in the (cmd == NULL) case, just as in the other case, in case the final free(tkdata) is triggered by a syntax error.
This commit is contained in:
parent
b148318981
commit
21a2eba44f
@ -8049,6 +8049,7 @@ vshCommandParse(vshControl *ctl, char *cmdstr)
|
||||
goto syntaxError; /* ... or ignore this command only? */
|
||||
}
|
||||
free(tkdata);
|
||||
tkdata = NULL;
|
||||
} else if (tk == VSH_TK_OPTION) {
|
||||
if (!(opt = vshCmddefGetOption(cmd, tkdata))) {
|
||||
vshError(ctl,
|
||||
|
Loading…
Reference in New Issue
Block a user