+ 5
what is memory leak?
what is memory leak?
3 Respostas
+ 8
when you allocate some memory and don't delete a memory leak occurs. It's called a leak because its just like a tap leak (waste of useful resource).
+ 3
YetAnotherCMemoryLeak:
void mem_leak() {
void *buf = malloc(1024);
}
The stack allocated pointer buf to the heap allocated memory (size: 1024 bytes) is lost when mem_leak() returns.