fix a seg fault when try copy a string to event's err_msg, there are still tons of memory leaking problem in Globals