I've noticed that xmalloc does not zero out the memory that's just been
allocated.  This doesn't jive well when adding new fields to existing structures
(specially these structures don't have a common constructor-type function to
initialize the memory).  What winds up happening is that these fields contain
garbage.  This is fine when these fields aren't used, but when these fields are
pointers, they are always used by the function that frees the memory causing a
core dump.

For safety, I propose that xmalloc zero out the memory it allocates.  Any
comments or rebuttals?

Noel


Reply via email to