From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1X3M-00053G-GA for qemu-devel@nongnu.org; Tue, 01 Nov 2016 07:16:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1X3I-0005z9-FG for qemu-devel@nongnu.org; Tue, 01 Nov 2016 07:16:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52440) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c1X3I-0005yu-AM for qemu-devel@nongnu.org; Tue, 01 Nov 2016 07:16:24 -0400 Message-ID: <1477998982.26731.32.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 01 Nov 2016 12:16:22 +0100 In-Reply-To: <58187760.41d71c0a.cca75.4cb9@mx.google.com> References: <58187760.41d71c0a.cca75.4cb9@mx.google.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Li Qiang Cc: qemu-devel@nongnu.org, Li Qiang On Di, 2016-11-01 at 04:06 -0700, Li Qiang wrote: > From: Li Qiang >=20 > In update_cursor_data_virgl function, if the 'width'/ 'height' > is not equal to current cursor's width/height it will return > without free the 'data' allocated previously. This will lead > a memory leak issue. This patch fix this issue. >=20 > Signed-off-by: Li Qiang > --- > hw/display/virtio-gpu.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c > index 60bce94..5f32e1a 100644 > --- a/hw/display/virtio-gpu.c > +++ b/hw/display/virtio-gpu.c > @@ -84,6 +84,7 @@ static void update_cursor_data_virgl(VirtIOGPU *g, > =20 > if (width !=3D s->current_cursor->width || > height !=3D s->current_cursor->height) { > + free(data); > return; > } > =20 Added to vga patch queue. thanks, Gerd