Received: from eggs.gnu.org ([2001:4830:134:3::10]:47111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5qzq-0005tX-Uu for qemu-devel@nongnu.org; Fri, 19 Jun 2015 03:45:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5qzq-0002Fl-0U for qemu-devel@nongnu.org; Fri, 19 Jun 2015 03:45:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5qzp-0002FR-SM for qemu-devel@nongnu.org; Fri, 19 Jun 2015 03:45:53 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 7BCAB391480 for ; Fri, 19 Jun 2015 07:45:53 +0000 (UTC) From: Paolo Bonzini Date: Fri, 19 Jun 2015 09:45:29 +0200 Message-Id: <1434699936-4433-9-git-send-email-pbonzini@redhat.com> In-Reply-To: <1434699936-4433-1-git-send-email-pbonzini@redhat.com> References: <1434699936-4433-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 08/15] libqos: Allow calling guest_free on NULL pointer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Fam Zheng From: Fam Zheng Signed-off-by: Fam Zheng Reviewed-by: John Snow Signed-off-by: Paolo Bonzini --- tests/libqos/malloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index 8276130..82b9df5 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -285,6 +285,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); -- 2.4.3