First:
$\texttt{int *p = (int *)malloc(sizeof(int));}$
allocates one integer block on the heap.
Then:
$\texttt{*p = 5;}$
stores $\texttt{5}$ in that first heap block.
Now:
$\texttt{p = (int *)malloc(sizeof(int));}$
allocates a second heap block and stores its address in $\texttt{p}$.
But the address of the first heap block is lost.
Since no pointer now stores the address of the first block, we cannot free it later.
This is called a memory leak.
Then:
$\texttt{*p = 10;}$
stores $\texttt{10}$ in the second heap block.
So:
$\texttt{printf("\%d", *p);}$
prints $\texttt{10}$
Finally:
$\texttt{free(p);}$
frees only the second block.
The first block remains leaked.
Answer: B