Memleak: put request local strings into the http-header array (we used SVPUT to manag...
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 15 Nov 2010 12:26:50 +0000 (13:26 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Mon, 15 Nov 2010 19:01:20 +0000 (20:01 +0100)
webcit/subst.c
webcit/webcit.c
webcit/webcit.h

index bc6c747fab82040f1eb4895f3f86417d22324882..ad3b9081a1b0bb6a239d2a96f06963d2b7ba6b1c 100644 (file)
@@ -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:
index 507f6a36537c45dd254735d6e198fc9421064580..64b42ee0ab63a292be29c8b6a8a787516296c17f 100644 (file)
 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)
 {
index 51976a5180996c5f7c7fa92f324637ad3b55e931..163830c4698d4d1099ff5410d4179aea39a53be3 100644 (file)
@@ -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);