qemu: agent: clear stale pointer in qemuAgentGetDisks

CVE-2026-77158

In case of hitting the cleanup label, the disks array
was freed but the pointer was not cleared, leading
to a possible double free.

Fixes: 0cb2d9f05d (v6.10.0-9-g0cb2d9f05d)
Closes: https://gitlab.com/libvirt/libvirt/-/work_items/910
Reported-by: David Korczynski (Ada Logics)
Found-by: Claude
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Ján Tomko committed 2026-08-24 16:03:31 +02:00
1 parent b8eb060035
commit 9d3adf8db6
1 file changed
+1 -1
+1 -1
View File
@@ -2562,7 +2562,7 @@ int qemuAgentGetDisks(qemuAgent *agent,
for (i = 0; i < ndata; i++) {
qemuAgentDiskInfoFree((*disks)[i]);
}
g_free(*disks);
g_clear_pointer(disks, g_free);
return -1;
}