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

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



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.

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®.