Yes, probably adding a new API that returns a malloced buffer is better.
Take into account that it also affects the `ZipUtils` class. So, there are about 4 or 5 API that need to be deprecated / replaced.