process_di() leaves esPtr unset when -d is used, since the defaultpath does not look up the current or requested ExpState.
The function still stores esPtr through esOut before returning. Current callers ignore esPtr when Default is true, but reading an uninitialized automatic variable is undefined behavior and can be reported by sanitizers.
Initialize esPtr to NULL so default-mode calls return a deterministic value.