How to best check if HeapAlloc() call was successful?

Started by Snowman, April 24, 2015, 11:47:51 AM

Previous topic - Next topic

Snowman

Hello, I am currently using HeapAlloc() in my program instead of malloc().
I need to check if the memory was correctly allocated. What should I do?

  • Check the return value of HeapAlloc()?
  • Use Structured Exception Handling (SEH)?
  • Use malloc() instead (and check its return value).

Sam Steele