Fixed memory leak related to retried requests.
ErrorState object was not destroyed if the failed request to the origin
server or peer was retried.
/* Ditch error page if it was created before.
* A new one will be created if there's another problem */
- err = NULL;
+ if (err) {
+ errorStateFree(err);
+ err = NULL;
+ }
/* use eventAdd to break potential call sequence loops and to slow things down a little */
eventAdd("fwdConnectStart", fwdConnectStartWrapper, this, originserver ? 0.05 : 0.005, 0);