From patchwork Thu Feb 4 20:13:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 44549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E418FB7D51 for ; Fri, 5 Feb 2010 07:25:56 +1100 (EST) Received: from localhost ([127.0.0.1]:57316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd8FZ-0005lr-M6 for incoming@patchwork.ozlabs.org; Thu, 04 Feb 2010 15:24:29 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd86s-0002BB-2K for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:30 -0500 Received: from [199.232.76.173] (port=51261 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd86r-0002B1-MF for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:29 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd86q-0004T4-95 for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:29 -0500 Received: from mx20.gnu.org ([199.232.41.8]:11913) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nd86p-0004Q4-Pk for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd86o-00042g-Nm for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:26 -0500 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 o14KFLSL012366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Feb 2010 15:15:21 -0500 Received: from localhost (vpn-9-202.rdu.redhat.com [10.11.9.202]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o14KFJ2L010232 for ; Thu, 4 Feb 2010 15:15:20 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Thu, 4 Feb 2010 18:13:13 -0200 Message-Id: <1265314396-6583-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1265314396-6583-1-git-send-email-lcapitulino@redhat.com> References: <1265314396-6583-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add an assert() to qobject_from_jsonf() to assure that the returned QObject is not NULL. Currently this is duplicated in the callers. Signed-off-by: Luiz Capitulino --- qjson.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qjson.c b/qjson.c index 9ad8a91..0922c06 100644 --- a/qjson.c +++ b/qjson.c @@ -62,6 +62,7 @@ QObject *qobject_from_jsonf(const char *string, ...) obj = qobject_from_jsonv(string, &ap); va_end(ap); + assert(obj != NULL); return obj; }