]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_conf: Fix double free problem for cfg->firmwares
authorTuguoyi <tu.guoyi@h3c.com>
Tue, 24 Nov 2020 03:12:00 +0000 (03:12 +0000)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 1 Dec 2020 13:26:33 +0000 (14:26 +0100)
commitc4f4e195a14c86b7daff2c45f1cbfd23ac16aaa8
treed405425439f7d454d7ccfc5c51fc260eabe066e9
parent0cbcd21b1f981dcca7879130a6653725db87d33a
qemu_conf: Fix double free problem for cfg->firmwares

cfg->firmwares still points to the original memory address after being
freed by virFirmwareFreeList(). As cfg get freed, it will be freed again
even if cfg->nfirmwares=0 which eventually lead to crash.

The patch fix it by setting cfg->firmwares to NULL explicitly after
virFirmwareFreeList() returns

Signed-off-by: Guoyi Tu<tu.guoyi@h3c.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_conf.c