From fe760dc897b3e9e56bf641385302154baa583b03 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 15 Nov 2010 13:26:50 +0100 Subject: [PATCH] Memleak: put request local strings into the http-header array (we used SVPUT to manage them in advance) --- webcit/subst.c | 2 +- webcit/webcit.c | 8 ++++++++ webcit/webcit.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/webcit/subst.c b/webcit/subst.c index bc6c747fa..ad3b9081a 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -529,7 +529,7 @@ void GetTemplateTokenString(StrBuf *Target, *Value = ChrPtr(Buf); *len = StrLength(Buf); /* we can't free it here, so we put it into the subst so its discarded later on. */ - ///SVPUTBuf(TKEY(N), Buf, 0); + PutRequestLocalMem(Buf, HFreeStrBuf); break; default: diff --git a/webcit/webcit.c b/webcit/webcit.c index 507f6a365..64b42ee0a 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -14,6 +14,14 @@ StrBuf *csslocal = NULL; HashList *HandlerHash = NULL; +void PutRequestLocalMem(void *Data, DeleteHashDataFunc DeleteIt) +{ + wcsession *WCC = WC; + int n; + + n = GetCount(WCC->Hdr->HTTPHeaders); + Put(WCC->Hdr->HTTPHeaders, IKEY(n), Data, DeleteIt); +} void DeleteWebcitHandler(void *vHandler) { diff --git a/webcit/webcit.h b/webcit/webcit.h index 51976a518..163830c46 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -658,6 +658,7 @@ void pullquote_fmout(void); void wDumpContent(int); +void PutRequestLocalMem(void *Data, DeleteHashDataFunc DeleteIt); void UrlescPutStrBuf(const StrBuf *strbuf); void StrEscPuts(const StrBuf *strbuf); -- 2.30.2