As grumpy has already told you in post #5, you have to free the memory in the caller of these functions. Thus you have to climb up the call stack until you find a place where your program doesn't need the resource anymore.
So for example you have to look at every function which calls save_string() and decide whether it's possible to free the memory there. If not you have to look again at the caller and so on.
Bye, Andreas