* don't leak post data
authorWilfried Göesgens <willi@citadel.org>
Wed, 7 Oct 2009 22:11:52 +0000 (22:11 +0000)
committerWilfried Göesgens <willi@citadel.org>
Wed, 7 Oct 2009 22:11:52 +0000 (22:11 +0000)
* set post data length, since there are still some functions dependg on it

webcit/webcit.c

index 8ba672388132075024e1207bdbd43dc894a07b72..2aaca0060d17cc11495090fd232f8a5a09147fc4 100644 (file)
@@ -521,6 +521,7 @@ void ReadPostData(void)
                free(Buf);
        } else if (WCC->Hdr->HR.ContentLength > 0) {
                WCC->upload = content;
+               WCC->upload_length = StrLength(WCC->upload);
                content = NULL;
        }
        FreeStrBuf(&content);
@@ -850,10 +851,9 @@ SessionDetachModule_WEBCIT
 {
        DeleteHash(&sess->Directory);
 
-       if (sess->upload_length > 0) {
-               FreeStrBuf(&sess->upload);
-               sess->upload_length = 0;
-       }
+       FreeStrBuf(&sess->upload);
+       sess->upload_length = 0;
+       
        FreeStrBuf(&sess->trailing_javascript);
 
        if (StrLength(sess->WBuf) > SIZ * 30) /* Bigger than 120K? release. */