Fix issue with the right click menus on the terminals

Nothing to see here other than a daft developer that was passing a
pointer to non malloced memory(bad idea)