From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YljnD-0003WB-9N for qemu-devel@nongnu.org; Fri, 24 Apr 2015 16:01:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yljn9-00017i-Au for qemu-devel@nongnu.org; Fri, 24 Apr 2015 16:01:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yljn9-00017Z-4r for qemu-devel@nongnu.org; Fri, 24 Apr 2015 16:01:39 -0400 Message-ID: <553AA11F.5040404@redhat.com> Date: Fri, 24 Apr 2015 16:01:35 -0400 From: John Snow MIME-Version: 1.0 References: <1429875320-410-1-git-send-email-famz@redhat.com> <1429875320-410-3-git-send-email-famz@redhat.com> In-Reply-To: <1429875320-410-3-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/5] libqos: Allow calling guest_free on NULL pointer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, afaerber@suse.de, stefanha@redhat.com On 04/24/2015 07:35 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > tests/libqos/malloc.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c > index 67f3190..c15be89 100644 > --- a/tests/libqos/malloc.c > +++ b/tests/libqos/malloc.c > @@ -283,6 +283,9 @@ uint64_t guest_alloc(QGuestAllocator *allocator, size_t size) > > void guest_free(QGuestAllocator *allocator, uint64_t addr) > { > + if (!addr) { > + return; > + } > mlist_free(allocator, addr); > if (allocator->opts & ALLOC_PARANOID) { > mlist_check(allocator); > Reviewed-by: John Snow