I read from many question here in SO and some other articles regarding free() function in c that frees the memory of unused variables. In my case, I have the following code
Since your function is returning strC, one presumes it must remain valid after the return of this function, thus this function must notfree() that buffer. Once it's freed, the buffer is no longer valid so must not be used.
Your caller is responsible for freeing it in this case.