dusk-network / wallet-core

The library responsible for the core functionality of a wallet
Mozilla Public License 2.0
6 stars 9 forks source link

Fix `allocate` and `free_mem` #112

Closed ureeves closed 6 months ago

ureeves commented 6 months ago

The use of mem::forget is extremely dangerous, as it gives no guarantee that the forgotten memory won't be clobbered. This PR fixes this making explicit use of the global allocator via the alloc and dealloc functions.

The one downside is that we explicitly copy returns from the module on every function call.

Resolves: #105