Memory leak is a problem that happens in programs when there is some unnecessary memory consumption or when program forgets to release the memory it used.
int *ngk = malloc(20);
In this program from the main function we are calling the function called karthi(). Inside that function we are allocating 10 bytes for a integer pointer using malloc function. But before using that allocated memory space that function ends and the allocated space doesn’t used and it still remains in memory as unused. This is called as memory leak.