Allocate memory for escaped string