Fix crash due to incorrect mxFree()