Use alloca instead of malloc/free for markup ptr.