If a function is returning a pointer and if that pointer was returned by a malloc function , how do I free that pointer ? If I run valgrind
, it will show memory leak since "k" was not freed. How do I free "k" in following ?
int * sum(int a, int b)