target/i386: avoid theoretical leak on MCE injection
commit42ccce19818e4e8fb55026f50b20d533cccc48f6
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 6 Oct 2020 07:48:23 +0000 (6 09:48 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Nov 2020 18:22:18 +0000 (16 13:22 -0500)
treefc7324c1a4c91e232539909657d065a157461847
parent3b12a7fd39307017c8968b8d05986a63b33752b5
target/i386: avoid theoretical leak on MCE injection

g_strdup_printf is used twice to write to the same variable, which
can theoretically cause a leak.  In practice, it is extremely
unlikely that a guest is seeing a recursive MCE and has disabled
CR4.MCE between the first and the second error, but we can fix it
and we can also make a slight improvement on the logic: CR4.MCE=0
causes a triple fault even for a non-recursive machine check, so
let's place its test first.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/helper.c