You should do one of two things: 1) export a custom freeing function and client code should call in order to free memory allocated on your side. This should use the appropriate freeing routine, ...