tool_operate: Fixed uninitialised variable under some error situations

For example when a URL is not specified or the headers file fails to
open.