About Wave Array error in free() on return from Solution::wave()


#1

*** Error in `./solution’: free(): invalid next size (normal): 0x000000000080e440 ***
Aborted.

How am I supposed to know why free() is failing outside of my function?