From: Wilfried Goesgens Date: Mon, 15 Nov 2010 12:26:50 +0000 (+0100) Subject: Memleak: put request local strings into the http-header array (we used SVPUT to manag... X-Git-Tag: v8.01~579 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;ds=sidebyside;h=fe760dc897b3e9e56bf641385302154baa583b03;p=citadel.git Memleak: put request local strings into the http-header array (we used SVPUT to manage them in advance) --- 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);