[#2212] CID26269:

Moved free of logfile to after its possible dereference