Answer is Heap Area since even if u dynamically allocate a memory region inside a function still that memory area won't be created inside the stack frame of that segment , it would be created in the heap region so even if u exit from the function without freeing the dynamically created node , it would be still persisting in the heap memory region .