From: Ian Jackson Subject: Re: [PATCH V2 02/11] libxl_json, Check the parser status before to call parse_complete Date: Tue, 25 Oct 2011 18:27:38 +0100 Message-ID: <20134.61834.867057.36715@mariner.uk.xensource.com> References: <1319133573-25891-1-git-send-email-anthony.perard@citrix.com> <1319133573-25891-3-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1319133573-25891-3-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony PERARD Cc: Xen Devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Anthony PERARD writes ("[Xen-devel] [PATCH V2 02/11] libxl_json, Check the parse> - status = yajl_parse_complete(yajl_ctx.hand); > + if (status == yajl_status_ok) { > + status = yajl_parse_complete(yajl_ctx.hand); > + } Perhaps this would be better done with the "goto out" pattern ? Ie: status = yajl_do_something(); if (status != yajl_status_ok) goto out; status = .... .... return o; out: blah blah get_error blah blah return NULL; That would make the logic clearer I think. Ian.