Received: from eggs.gnu.org ([2001:4830:134:3::10]:56767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzlkl-0001V8-6M for qemu-devel@nongnu.org; Thu, 27 Oct 2016 10:34:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzlkh-0002cF-CL for qemu-devel@nongnu.org; Thu, 27 Oct 2016 10:33:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49178) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bzlkh-0002bP-6K for qemu-devel@nongnu.org; Thu, 27 Oct 2016 10:33:55 -0400 From: Gerd Hoffmann Date: Thu, 27 Oct 2016 16:33:45 +0200 Message-Id: <1477578825-31507-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1477578825-31507-1-git-send-email-kraxel@redhat.com> References: <1477578825-31507-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 1/1] virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Li Qiang , Gerd Hoffmann , "Michael S. Tsirkin" From: Li Qiang In virtio gpu resource create dispatch, if the pixman format is zero it doesn't free the resource object allocated previously. Thus leading a host memory leak issue. This patch avoid this. Signed-off-by: Li Qiang Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 57df486e.8379240a.c3620.ff81@mx.google.com Signed-off-by: Gerd Hoffmann --- hw/display/virtio-gpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index fa6fd0e..60bce94 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -333,6 +333,7 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *= g, qemu_log_mask(LOG_GUEST_ERROR, "%s: host couldn't handle guest format %d\n", __func__, c2d.format); + g_free(res); cmd->error =3D VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; return; } --=20 1.8.3.1