On 5 May 2014, at 18:42, Andrey Chernov <a...@freebsd.org> wrote:

> Please don't commit OpenBSD errors. Now you mix calloc() with the
> realloc() for the same variable later which makes calloc() zeroing
> pointless and waste of CPU.

The purpose of calloc() here is not (primarily) to get the zero'd size, it's to 
get the overflow-checking behaviour for calloc.  

The uses of realloc() later do still potentially overflow, as they follow the 
realloc(pointer, size * sizeof(type)) antipattern.  

David

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to