]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
* load_mimepart() was including protocol chatter in its data buffer. Fixed.
[citadel.git] / webcit / messages.c
index 055009199cf6cfc05193dc627fe1e6424e1ea8ae..97d7f02fb404ccff6305882e528a8b9b93bfaac8 100644 (file)
@@ -426,7 +426,7 @@ int load_msg_ptrs(const char *servcmd, int with_headers)
        long len;
        int n;
        int skipit;
-       const char *Ptr;
+       const char *Ptr = NULL;
 
        if (WCC->summ != NULL) {
                DeleteHash(&WCC->summ);
@@ -884,6 +884,8 @@ void readloop(long oper)
                        case VIEW_ADDRESSBOOK:
                                ab_name = NULL;
                                fetch_ab_name(Msg, &ab_name);
+                               if (ab_name == NULL) 
+                                       break;
                                ++num_ab;
                                addrbook = realloc(addrbook,
                                                   (sizeof(addrbookent) * num_ab) );
@@ -1624,7 +1626,8 @@ StrBuf *load_mimepart(long msgnum, char *partnum)
        if (GetServerStatus(Buf, NULL) == 6) {
                StrBufCutLeft(Buf, 4);
                bytes = StrBufExtract_long(Buf, 0, '|');
-
+               FreeStrBuf(&Buf);
+               Buf = NewStrBuf();
                StrBuf_ServGetBLOBBuffered(Buf, bytes);
                return(Buf);
        }
@@ -1763,3 +1766,10 @@ InitModule_MSG
        WebcitAddUrlHandler(HKEY("roommsgs"), jsonMessageList,0);
        return ;
 }
+
+void
+SessionDetachModule_MSG
+(wcsession *sess)
+{
+       DeleteHash(&sess->summ);
+}