+ 5

what is memory leak?

what is memory leak?

7th Feb 2018, 2:32 PM
Ubair Noor
Ubair Noor - avatar
4 Answers
+ 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).
7th Feb 2018, 2:47 PM
shobhit
shobhit - avatar
7th Feb 2018, 2:47 PM
Vukan
Vukan - avatar
+ 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.
8th Feb 2018, 5:47 PM
Linus Liberty
Linus Liberty - avatar