Fixed memory leak from mallocing in C and forgetting to free in rust