On Wed, Apr 08, 2015 at 04:49:58PM +0100, Ian Jackson wrote: > Wei Liu writes ("[PATCH 3/4] libxenstat: always free qmp_stats"): > > Originally qmp_stats is only freed in failure path and leaked in success > > path. > > > > Instead of wiring up the success path, rearrange the code a bit to > > always free qmp_stats before checking if info is NULL. > > Acked-by: Ian Jackson <ian.jack...@eu.citrix.com> > > Having said that, I am not a great fan of the error handling cleanup > style adopted in this code in general. The ownership and lifetime of > the various allocated objects has to be inferred by reading the code > in detail. >
Yeah... I'm with you. On the other hand I want my bug fix patch to be as small as possible. Changing this function to goto style will make the patch a lot bigger. I think we can clean this function up with another patch if anyone feels keen enough. Wei. > Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel