target/i386: fix strList leak in x86_cpu_get_unavailable_features
The result list built by x86_cpu_list_feature_names() was never freed after being visited, causing a memory leak detected by ASan. (the getter visitor is VISITOR_OUTPUT kind and doesn't own data) Fixes: 506174bf8219 ("i386: "unavailable-features" QOM property") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Link: https://lore.kernel.org/r/20260413125040.3842686-1-marcandre.lureau@redhat.com Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Marc-André Lureau committed
Apr 13, 2026 at 16:50 UTC
87e1226e6f6844845ac407d50198d84205e7ed7f
1 file changed
+1
target/i386/cpu.c
+1
@@ -7842,6 +7842,7 @@ static void x86_cpu_get_unavailable_features(Object *obj, Visitor *v,
7842
7843
x86_cpu_list_feature_names(xc->filtered_features, &result);
7844
visit_type_strList(v, "unavailable-features", &result, errp);
7845
+ qapi_free_strList(result);
7846
}
7847
7848
/* Print all cpuid feature names in featureset