From d574d7121215c86414c12503d22bf9df286816db Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sun, 11 Oct 2015 23:26:01 +0200 Subject: [PATCH] fix memory leak for invavlid HTTP-Heeaders --- webcit/context_loop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webcit/context_loop.c b/webcit/context_loop.c index fd13b97f1..f02a61991 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -397,7 +397,11 @@ int ReadHTTPRequest (ParsedHttpHdrs *Hdr) nLine ++; Line = NewStrBufPlain(NULL, SIZ / 4); - if (ClientGetLine(Hdr, Line) < 0) return 1; + if (ClientGetLine(Hdr, Line) < 0) { + FreeStrBuf(&Line); + isbogus = 1; + break; + } if (StrLength(Line) == 0) { FreeStrBuf(&Line); -- 2.30.2