[Libvir] [patch 2/5] iptables: use calloc() instead of malloc()/memset()

Daniel Veillard veillard at redhat.com
Wed Mar 21 13:07:00 UTC 2007


On Wed, Mar 21, 2007 at 12:47:59PM +0000, Mark McLoughlin wrote:
> Replace a few instances of malloc() followed by memset(0) with
> calloc()

  Humpf, that's just the opposite of the other parts of libvirt I wrote.
Could you justify ? 
  It's hard to catch it's a calloc or a malloc call, and hence notice
if it was initialized or not. The extra memset line makes it clear, plus
it will allow me more easilly to plug in libxml2 memory wrapper.
  I doubt the patch is related to other parts needed for the restart code
it's just coding policy and IMHO different from teh rest of libvirt.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list