Top "Free" questions

Do not use this tag to refer to free software.

What is the difference between freeing the pointer and assigning it to NULL?

Could somebody tell me the difference between: int *p; p=(int*)malloc(10*sizeof(int)); free(p); or int *p; p=(…

c pointers free
Can a call to free() in C ever fail?

Can a call to free() fail in any way? For example: free(NULL);

c memory-management free
Can I free() static and automatic variables in C?

The code is as follow : #include <stdlib.h> int num = 3; // Static external variable int *ptr = &num; int …

c free scope static-variables dynamic-allocation
Using realloc (X, 0) instead of free() and using malloc with length of a string +1

So I don't really know how to put the title this time. First of all I'd like to say that …

c memory-management free realloc
Printing pointer addresses in C [two questions]

I know that my questions are very simple but googleing them didn't get me any useful results... They'r probably too …

c pointers int free command-line-arguments
Should I free memory before exit?

Should I free all my mallocated memory when I am exiting program in the due of error? something = (char**) malloc (…

c malloc free dynamic-allocation
How do I free a pointer returned from a function?

#include <stdio.h> #include <string.h> #include <stdlib.h> char* f(void) { char *x; …

c memory dynamic malloc free
Reusing freed pointers in C

There are many questions on this website regarding freeing pointers after use and, further, setting them to NULL. Arguments are …

c pointers free
How do I free the contents of a TList?

I have this code in Delphi 4. I created 10 objects of type T_Charge (see below), which I added to a …

delphi free tlist delphi-4
Heap corruption while freeing memory

I have a class as follows struct CliHandler { CliHandler(int argc, char** argv); ~CliHandler(); int doWork(); int argc_; char** argv_; …

c++ malloc free heap-corruption