
Error "free"-ing "malloc"-ed memory
You should state exactly the error message, otherwise we can't help. =
Your code has probably been simplified, as it is it can't crash, the =
problem must be elsewhere. Two cases: 1) you called free more than once, =
2) you corrupted the heap by writing outside of the allocated block. =
Both cases can be trapped as assertions by the debug libraries.
alberto
--=20
Quote:
> I am developing a Windows NT console application with some code =
similar to
> the example below. When I am freeing the Data pointer I get some debug
> messages about "assertion error"; the pointer seems to be invalid. Do =
I have
> to free the memory block inside the same function as it is allocated =
or
> what?