Received: from eggs.gnu.org ([2001:4830:134:3::10]:38220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyiIA-0008Dg-QD for qemu-devel@nongnu.org; Tue, 17 Nov 2015 10:35:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyiI6-0003fy-Iv for qemu-devel@nongnu.org; Tue, 17 Nov 2015 10:35:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyiI6-0003ft-AZ for qemu-devel@nongnu.org; Tue, 17 Nov 2015 10:35:30 -0500 From: Markus Armbruster References: <1444739866-14798-1-git-send-email-berrange@redhat.com> <1444739866-14798-2-git-send-email-berrange@redhat.com> <87lh9wodgd.fsf@blackfin.pond.sub.org> <20151117152747.GJ14972@redhat.com> Date: Tue, 17 Nov 2015 16:35:27 +0100 In-Reply-To: <20151117152747.GJ14972@redhat.com> (Daniel P. Berrange's message of "Tue, 17 Nov 2015 15:27:47 +0000") Message-ID: <878u5wmyf4.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 1/7] qom: introduce ObjectPropertyIterator struct for iteration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Paolo Bonzini , Pavel Fedin , qemu-devel@nongnu.org, Andreas =?utf-8?Q?F=C3=A4rber?= "Daniel P. Berrange" writes: > On Tue, Nov 17, 2015 at 04:25:22PM +0100, Markus Armbruster wrote: >> I apologize for the lateness of my review. > >> > +void object_property_iter_free(ObjectPropertyIterator *iter) >> > +{ >> > + if (!iter) { >> > + return; >> > + } >> > + g_free(iter); >> >> g_free(NULL) is perfectly safe; please drop the conditional. > > The next patch in the series has to free some fields in 'iter' > so the check for NULL upfront is not redundant. I'd add the conditional when it's actually needed, not least to avoid comments from picky reviewers like myself ;) Anyway, not worth a respin by itself. However, I'd very much prefer the iterators to follow precedence in the tree.