* handle new strbufs in wcsession correctly
authorWilfried Göesgens <willi@citadel.org>
Mon, 26 Jan 2009 00:30:22 +0000 (00:30 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 26 Jan 2009 00:30:22 +0000 (00:30 +0000)
webcit/context_loop.c
webcit/roomops.c

index fd0b0fe045ca1adcba8b556856c3663e15775967..a11b930d2873c035084d5eb201b70d896a6db006 100644 (file)
@@ -518,14 +518,11 @@ void context_loop(int *sock)
                }
                else TheSession->httpauth_pass = NewStrBufPlain(httpauth_user, -1);
 
+               TheSession->CLineBuf = NewStrBuf();
                TheSession->hash_prefs = NewHash(1,NULL);       /* Get a hash table for the user preferences */
                pthread_mutex_init(&TheSession->SessionMutex, NULL);
                pthread_mutex_lock(&SessionListMutex);
-               TheSession->urlstrings = NULL;
-               TheSession->vars = NULL;
                TheSession->nonce = rand();
-               TheSession->WBuf = NULL;
-               TheSession->CLineBuf = NewStrBuf();
                TheSession->next = SessionList;
                TheSession->is_mobile = -1;
                SessionList = TheSession;
index 30cc875e96dba5cc2aff14ce55fc3819fc2d5a05..677fa66c1fb545e4e52eb4146aa9f65b9f1b8bb0 100644 (file)
@@ -496,7 +496,8 @@ void embed_room_banner(char *got, int navbar_style) {
         * we want it to remember the URL as a "/dotskip" one instead of
         * a "skip" or "gotonext" or something like that.
         */
-       FreeStrBuf(&WC->this_page);
+       if (WC->this_page == NULL)
+               WC->this_page = NewStrBuf();
        StrBufPrintf(WC->this_page, 
                     "dotskip&room=%s",
                     ChrPtr(WC->wc_roomname));