From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rb86L-0000N7-UY for qemu-devel@nongnu.org; Thu, 15 Dec 2011 04:59:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rb86G-0008Ac-Dl for qemu-devel@nongnu.org; Thu, 15 Dec 2011 04:59:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rb86G-0008AR-62 for qemu-devel@nongnu.org; Thu, 15 Dec 2011 04:59:40 -0500 Message-ID: <4EE9C5BF.1070400@redhat.com> Date: Thu, 15 Dec 2011 11:02:39 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <4EE9AB5A.4080306@linux.vnet.ibm.com> <20111215082828.GA33201@cs.nctu.edu.tw> <20111215093637.GA387@stefanha-thinkpad.localdomain> In-Reply-To: <20111215093637.GA387@stefanha-thinkpad.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] some questions about g_malloc in qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: QEMU-devel , Zhi Hui Li , zhihuili@cn.ibm.com, =?UTF-8?B?6Zmz6Z+L5Lu7?= , Stefan Hajnoczi Am 15.12.2011 10:36, schrieb Stefan Hajnoczi: > On Thu, Dec 15, 2011 at 04:28:28PM +0800, =E9=99=B3=E9=9F=8B=E4=BB=BB w= rote: >> I found this in HACKING: >> >> Please note that NULL check for the g_malloc result is redundant and >> that g_malloc() call with zero size is not allowed. >=20 > So we have: >=20 > 1. You should not request 0 bytes from g_malloc(). I think this was related to qemu_malloc() and Anthony's sed run made it refer to g_malloc(), even though it works just fine with 0 bytes. We should probably remove this sentence. Kevin