There is no return value because there is no case of failure. free always succeeds. There is nothing to check.
Please note that this assumes that you are using it correctly. If you go to a free pointer that is not valid as an argument for free , for example, an uninitialized pointer, a pointer to an already freed object, or a pointer to an object not obtained with malloc , then your program has undefined behavior . This is not a reporting error; rather, it means anything can happen .
R .. source share