]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
Memleak: post_message(): don't forget about the recipient buffer.
[citadel.git] / webcit / messages.c
index d62f69bdf648542c8ab55acf1b6b24c8623c2f52..9286d3992bc90eac6a3cb8db29786c891ac1cfaf 100644 (file)
@@ -1076,7 +1076,7 @@ void post_message(void)
                return;
        }
 
-       if (havebstr("cancel_button")) {
+       if (!strcasecmp(bstr("submit_action"), "cancel")) {
                sprintf(WCC->ImportantMessage, 
                        _("Cancelled.  Message was not posted."));
        } else if (havebstr("attach_button")) {
@@ -1125,7 +1125,7 @@ void post_message(void)
                int save_to_drafts;
                long HeaderLen;
 
-               save_to_drafts = havebstr("save_button");
+               save_to_drafts = !strcasecmp(bstr("submit_action"), "drafts");
                Buf = NewStrBuf();
 
                if (save_to_drafts) {
@@ -1256,6 +1256,7 @@ void post_message(void)
                                return;
                        }
                }
+               FreeStrBuf(&Recp);
                FreeStrBuf(&Buf);
                FreeStrBuf(&Cc);
                FreeStrBuf(&Bcc);