I have a question regarding free() in C. Suppose I have a pointer to some struct (say node *ptr).. after freeing it can i Initialize it to NULL and make it point to some new location using malloc() o
I have a long-living application with frequent memory allocation-deallocation. Will any malloc implementation return freed memory back to the system?
I have a command line C program for which I use the calloc() function to assign some memory for a struct which also has a struct in it with some memory assigned.
I\'m trying to figure out what would happened if I try to free a pointer \"from the middle\" for example, look at the following code:
There seem to be two arguments why one should set a pointer to NULL after freeing them. Avoid crashing when double-freeing pointers.
I am having problems with a fairly complex code. I wasn\'t able to produce a short snippet that reproduces the error, so I\'ll try to explain the problem in words.
Say you have the following ANSI C code that initializes a multi-dimensional array : int main() { i开发者_C百科nt i, m = 5, n = 20;
I have an object that I\'m freeing with delete, and it has a char* that\'s being freed with free in its destructor. The reason I\'m using free is because I used strdup and mallo开发者_开发问答c in cre
When using malloc, if it produces a core dump with the error:开发者_开发问答 malloc(): memory corruption: ....... ***