From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUC8n-00028v-If for qemu-devel@nongnu.org; Wed, 17 Sep 2014 06:07:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUC8i-00073J-On for qemu-devel@nongnu.org; Wed, 17 Sep 2014 06:07:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUC8i-000736-Gl for qemu-devel@nongnu.org; Wed, 17 Sep 2014 06:07:08 -0400 From: Markus Armbruster References: <1410833973-9492-1-git-send-email-arei.gonglei@huawei.com> <87oaugxbvp.fsf@blackfin.pond.sub.org> <33183CC9F5247A488A2544077AF1902086DD5209@SZXEMA503-MBS.china.huawei.com> <87sijst2qh.fsf@blackfin.pond.sub.org> <33183CC9F5247A488A2544077AF1902086DD6BDB@SZXEMA503-MBS.china.huawei.com> Date: Wed, 17 Sep 2014 12:06:54 +0200 In-Reply-To: <33183CC9F5247A488A2544077AF1902086DD6BDB@SZXEMA503-MBS.china.huawei.com> (Gonglei's message of "Wed, 17 Sep 2014 09:17:05 +0000") Message-ID: <87vbompnlt.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] qdev-monitor: fix segmentation fault on qdev_device_help() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" Cc: "Huangweidong (C)" , "qemu-devel@nongnu.org" , "Huangpeng (Peter)" , "lcapitulino@redhat.com" , "stefanha@redhat.com" , "imammedo@redhat.com" , "afaerber@suse.de" "Gonglei (Arei)" writes: >> > >> >> > >> Doesn't this leak prop_list when local_err && prop_list? >> > >> >> > > No, it will not happen this situation. >> > > >> > >> Returning both a value in need of destruction and an error object is at >> > >> least highly unusual, and probably plain wrong. >> > >> >> > >> Should qmp_device_list_properties() return NULL when it sets an error? >> > > >> > > Yes, it was. >> > >> > I think I'm starting to understand now. >> > >> > You backtrace shows qmp_device_list_properties() returned null without >> > setting an error. But this is okay, because null means "empty list", >> > which is a valid return value. >> > >> Yes. >> >> > A systematic search for this kind of incorrect error handling would be >> > nice: search for functions returning QAPI lists, then look for callers >> > interpreting a null value as error. Would you be willing to do that? >> > >> Yes, I would. >> > Hi, Markus > I have finished this work, and not found this kind of error. :) Thanks!