win: include "malloc.h"
As stated in malloc's docs[1], the malloc.h is required for using the malloc function, and from malloc.h's source code (which can be found under installed VS), malloc is defined as a macro that has different behaviors under different configurations. So using malloc without including malloc.h is very dangerous, for certain build configurations crashes can happen when writing to memory allocated by malloc. [1]: https://msdn.microsoft.com/en-us/library/6ewkz86d.aspx PR-URL: https://github.com/libuv/libuv/pull/395 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
parent
c619f37c39
commit
c0c26a0f07
@ -29,7 +29,9 @@
|
||||
#include <stdlib.h> /* malloc */
|
||||
#include <string.h> /* memset */
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#if defined(_WIN32)
|
||||
# include <malloc.h> /* malloc */
|
||||
#else
|
||||
# include <net/if.h> /* if_nametoindex */
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user