Did you miss delete[] msg?