[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xl: free default_{vifscript, bridge, gatewaydev} on exit



On Wed, 2013-06-12 at 13:41 +0100, Ian Jackson wrote:
> Ian Campbell writes ("[PATCH] xl: free default_{vifscript,bridge,gatewaydev} 
> on exit"):
> > These leaks aren't serious, since they are only in xl but this makes "xl 
> > list"
> > clean according to valgrind, which is useful from the point of view of
> > eliminating false positives when looking at the state of libxl (where leaks
> > matter).
> ...
> > +    if (default_vifscript) {
> > +        free(default_vifscript);
> > +        default_vifscript = NULL;
> 
> These ifs are unnecessary.  free(NULL) is a no-op.
> 
> I would write:
> 
> +        free(default_vifscript);   default_vifscript = NULL;
> +        free(default_bridge);      default_bridge = NULL;
> +        free(default_gatewaydev);  default_gatewaydev = NULL;
> 
> which is nice and regular.

So would I except this is the prevailing style in that function for some
reason (even though I have a feeling I wrote it).

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.