Fix dangling pointer. Likely cause for crashes; could be that mingw64 crash.
Apply the same fix to another part of the code.
Fix check_volume