you use the free() function

int * sum(int a, int b)
{
int sum;
int *k=malloc(sizeof(int));
sum=a+b;
k=∑
return k;
free(k);
}