The malloc function in C is allocated memory, and the variables of the inner life of the function allocate memory, but when the function is released, the memory is freed so that it does not consume memory, but the malloc function is different.
As follows
typedef struct NODE
{
int A;
Node* Next;
}lnode,*llist;
Llist a= (llist) malloc (sizeof (Lnode));
This line is the code that allocates memory, if this function is called in a function, the memory allocated by the function will persist unless it is released.
Free (a);
This line of code is the code that frees the memory,
There is no relation to releasing the memory in turn, but if the function is called more than once, it is very prone to problems.
For example, I wrote a chess program, which only allocates the memory of the structure of the above example size, and does not release
That code ran hundreds of millions of times, every time my program was in memory, and then I found out what the reason was.
So the memory that you allocate, the tears you have to release it.
malloc kills memory in invisible