diff mbox series

[PULL,19/20] target/i386/cpu: Fix memleak in x86_cpu_class_check_missing_features

Message ID 20200902115323.850385-20-ehabkost@redhat.com
State New
Headers show
Series x86 and machine queue, 2020-09-02 | expand

Commit Message

Eduardo Habkost Sept. 2, 2020, 11:53 a.m. UTC
From: Pan Nengyuan <pannengyuan@huawei.com>

'err' forgot to free in x86_cpu_class_check_missing_features error path.
Fix that.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200831134315.1221-7-pannengyuan@huawei.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index ba4667b33c..49d8958528 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4947,6 +4947,7 @@  static void x86_cpu_class_check_missing_features(X86CPUClass *xcc,
         new->value = g_strdup("type");
         *next = new;
         next = &new->next;
+        error_free(err);
     }
 
     x86_cpu_filter_features(xc, false);