qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eduardo Habkost
Subject: [PULL 19/20] target/i386/cpu: Fix memleak in x86_cpu_class_check_missing_features
Date: Wed, 2 Sep 2020 07:53:22 -0400

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 --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);
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]