A89: when malloc fails...


[Prev][Next][Index][Thread]

A89: when malloc fails...




Hello.

Consider the following scenario:
In a C program, some function attempts to malloc() memory and fails due to
the lack of available RAM. Apparently, the program must exit(). But If I do
so, what happens to the memory that was previously allocated on the calling
level? Is it leaked? If it is, do I handle a situation like this?

Thank you.

Sincerely,

Alex Astashyn.




Follow-Ups: