From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58802 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q36G1-0002bA-5I for qemu-devel@nongnu.org; Fri, 25 Mar 2011 08:36:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q36G0-0005pf-0o for qemu-devel@nongnu.org; Fri, 25 Mar 2011 08:36:49 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:56871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q36Fz-0005pb-S3 for qemu-devel@nongnu.org; Fri, 25 Mar 2011 08:36:47 -0400 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e1.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p2PCQbxb019529 for ; Fri, 25 Mar 2011 08:26:37 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id C8B0638C8038 for ; Fri, 25 Mar 2011 08:36:40 -0400 (EDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p2PCajqN478222 for ; Fri, 25 Mar 2011 08:36:46 -0400 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p2PCailw023679 for ; Fri, 25 Mar 2011 06:36:45 -0600 Message-ID: <4D8C8C5B.5080807@us.ibm.com> Date: Fri, 25 Mar 2011 07:36:43 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2] severe memory leak caused by broken palette_destroy() function References: <942456759.505022.1301042552254.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <963102742.505036.1301042754895.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Ulrich Obergfell , qemu-devel@nongnu.org On 03/25/2011 04:31 AM, Stefan Hajnoczi wrote: > On Fri, Mar 25, 2011 at 8:45 AM, Ulrich Obergfell wrote: >> This is version 2 of the patch that I originally posted in: >> >> http://lists.gnu.org/archive/html/qemu-devel/2011-03/msg02063.html >> >> [Sorry, I missed to include the keyword 'PATCH' in the subject >> of the original post.] >> >> The following commit breaks the code of the function palette_destroy(). >> >> http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=e31e3694afef58ba191cbcc6875ec243e5971268 >> >> The broken code causes a severe memory leak of 'VncPalette' structures >> because it never frees anything: >> >> 70 void palette_destroy(VncPalette *palette) >> 71 { >> 72 if (palette == NULL) { >> 73 qemu_free(palette); >> 74 } >> 75 } >> >> Version 2 of the patch calls qemu_free() unconditionally. >> >> Signed-off-by: Ulrich Obergfell > Looks good. Applied. Thanks. Regards, Anthony Liguori > Reviewed-by: Stefan Hajnoczi