What to do if malloc() returns a valid pointer, but sets errno to non-zero? In Microsoft’s documentation for malloc(), there are the following two statements: