MSG: we can continue using the strbuf, ommit the wrapper function here.
[citadel.git] / citadel / msgbase.c
index 1fff6dc474d891ef3a838937d1d109f877a3f87f..2cd006d2e02b406648d90d11b399596d0e895d3a 100644 (file)
@@ -3436,6 +3436,7 @@ struct CtdlMessage *CtdlMakeMessageLen(
        }
        StrBufRFC2047encode(&FakeEncAuthor, FakeAuthor);
        CM_SetAsFieldSB(msg, eAuthor, &FakeEncAuthor);
+       FreeStrBuf(&FakeAuthor);
 
        if (CCC->room.QRflags & QR_MAILBOX) {           /* room */
                CM_SetField(msg, eOriginalRoom, &CCC->room.QRname[11], strlen(&CCC->room.QRname[11]));
@@ -3496,9 +3497,10 @@ struct CtdlMessage *CtdlMakeMessageLen(
                CM_SetField(msg, eMesageText, preformatted_text, textlen);
        }
        else {
-               preformatted_text = CtdlReadMessageBody(HKEY("000"), config.c_maxmsglen, NULL, 0, 0);
-               if (preformatted_text != NULL) {
-                       CM_SetField(msg, eMesageText, preformatted_text, strlen(preformatted_text));
+               StrBuf *MsgBody;
+               MsgBody = CtdlReadMessageBodyBuf(HKEY("000"), config.c_maxmsglen, NULL, 0, 0);
+               if (MsgBody != NULL) {
+                       CM_SetAsFieldSB(msg, eMesageText, &MsgBody);
                }
        }