Commit c6a24d71 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Fix memory leak in time to first byte handling

Fixes #898

Thanks to omes and vorpal for diagnosis and patch
parent 2c8505ba
...@@ -219,6 +219,7 @@ clean_logline(struct logline *lp) ...@@ -219,6 +219,7 @@ clean_logline(struct logline *lp)
freez(lp->df_m); freez(lp->df_m);
freez(lp->df_s); freez(lp->df_s);
freez(lp->df_u); freez(lp->df_u);
freez(lp->df_ttfb);
#undef freez #undef freez
memset(lp, 0, sizeof *lp); memset(lp, 0, sizeof *lp);
} }
...@@ -471,7 +472,7 @@ collect_client(struct logline *lp, enum vsl_tag tag, unsigned spec, ...@@ -471,7 +472,7 @@ collect_client(struct logline *lp, enum vsl_tag tag, unsigned spec,
char ttfb[64]; char ttfb[64];
if (!lp->active) if (!lp->active)
break; break;
if (sscanf(ptr, "%*u %*u.%*u %ld.%*u %*u.%*u %s", &l, ttfb) != 2) { if (lp->df_ttfb != NULL || sscanf(ptr, "%*u %*u.%*u %ld.%*u %*u.%*u %s", &l, ttfb) != 2) {
clean_logline(lp); clean_logline(lp);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment