A memory leak occurs when a program loses the ability to free a block of dynamically allocated memory..