correct memory allocation in mkl