actually openbsd has something like this: mallocarray [1] and reallocarray [2] (OMG realloc) actually here [3] they say that use of these function in libressl and the openbsd port of the http server, etc.<p>[1] <a href="http:&#x2F;&#x2F;www.openbsd.org&#x2F;cgi-bin&#x2F;man.cgi&#x2F;OpenBSD-current&#x2F;man9&#x2F;mallocarray.9" rel="nofollow">http:&#x2F;&#x2F;www.openbsd.org&#x2F;cgi-bin&#x2F;man.cgi&#x2F;OpenBSD-current&#x2F;man9&#x2F;...</a><p>[2] <a href="http:&#x2F;&#x2F;www.openbsd.org&#x2F;cgi-bin&#x2F;man.cgi&#x2F;OpenBSD-current&#x2F;man3&#x2F;calloc.3?query=reallocarray&amp;arch=i386" rel="nofollow">http:&#x2F;&#x2F;www.openbsd.org&#x2F;cgi-bin&#x2F;man.cgi&#x2F;OpenBSD-current&#x2F;man3&#x2F;...</a><p>[3] <a href="http:&#x2F;&#x2F;www.openbsd.org&#x2F;papers&#x2F;httpd-asiabsdcon2015.pdf" rel="nofollow">http:&#x2F;&#x2F;www.openbsd.org&#x2F;papers&#x2F;httpd-asiabsdcon2015.pdf</a>