News for hackers. Stuff that matters.
Re:Calloc or Malloc? Any thoughts? by dmm on Wednesday August 13, 2008 @12:13PM (#275098)
From the openbsd man page malloc(3):

When using malloc() be careful to avoid the following idiom:

           if ((p = malloc(num * size)) == NULL)
                   err(1, "malloc");

     The multiplication may lead to an integer overflow.  To avoid this, calloc() is recommended.
Re:Calloc or Malloc? Any thoughts? by sysop073 on Thursday August 14, 2008 @02:05AM (#275868)
Maybe it's different on OpenBSD, but I think the spec says they're essentially equivalent; i.e. it's permissible to just call malloc with the product from within calloc