From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mz48h-0005lA-5B for qemu-devel@nongnu.org; Sat, 17 Oct 2009 03:55:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mz48c-0005ip-CF for qemu-devel@nongnu.org; Sat, 17 Oct 2009 03:55:46 -0400 Received: from [199.232.76.173] (port=40192 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mz48c-0005im-91 for qemu-devel@nongnu.org; Sat, 17 Oct 2009 03:55:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28872) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mz48b-0001xX-PW for qemu-devel@nongnu.org; Sat, 17 Oct 2009 03:55:42 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9H7terY032294 for ; Sat, 17 Oct 2009 03:55:41 -0400 From: Paolo Bonzini Date: Sat, 17 Oct 2009 09:55:31 +0200 Message-Id: <1255766136-3028-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1255766136-3028-1-git-send-email-pbonzini@redhat.com> References: <1255766136-3028-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 2/7] allow passing NULL to qobject_type List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Luiz Capitulino Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- qobject.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qobject.h b/qobject.h index 4cc9287..200644d 100644 --- a/qobject.h +++ b/qobject.h @@ -102,6 +102,8 @@ static inline void qobject_decref(QObject *obj) */ static inline qtype_code qobject_type(const QObject *obj) { + if (!obj) + return QTYPE_NONE; assert(obj->type != NULL); return obj->type->code; } -- 1.6.2.5