Memory leak with BigNumber and toString()

The BigNumber.toString() method returns a pointer to a character (array), not a String object.

It dynamically allocates memory using malloc() but never frees it (as it can't because you would loose the result). Your solution is perfect.

This has nothing to do with the String class.

// Edit
I see that I was far to slow, @johnwasser beat me to it :wink:

1 Like