hw/display: don't accidentally autofree existing virgl resources
While sanity checking a create blob operation the use of the auto freed res variable could lead to inadvertently freeing an existing blob. Avoid this by in-lining the virtio_gpu_virgl_find_resource() check as the value is not needed anyway. While at it add a comment to the end and use g_steal_pointer to make it clearer the object lifetime exceeds the function bounds if we pass all the checks. Fixes: CVE-2026-6502 Fixes: 7c092f17cce (virtio-gpu: Handle resource blob commands) Message-ID: 20260417094443.785462-1-alex.bennee@linaro.org Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Cc: qemu-stable@nongnu.org Message-ID: <20260417122703.845442-1-alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>