X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=a58093bbe38e6197b66f4dd0f2b2ca473eb2d9ce;hb=82f16d0aaee6a7f5b9ce12d445fdb796fb72bebd;hp=9d73668436c3df6329b3d076e534bb51b955c433;hpb=482fe3b2b4e0d16b987e1353fc28abbcfc2c07a4;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 9d7366843..a58093bbe 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -3186,8 +3186,6 @@ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ syslog(LOG_DEBUG, "Delivering private local mail to <%s>\n", recipient); if (CtdlGetUser(&userbuf, recipient) == 0) { - // Add a flag so the Funambol module knows its mail - msg->cm_fields['W'] = strdup(recipient); CtdlMailboxName(actual_rm, sizeof actual_rm, &userbuf, MAILROOM); CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0, msg); CtdlBumpNewMailCounter(userbuf.usernum); @@ -3650,10 +3648,10 @@ struct CtdlMessage *CtdlMakeMessage( msg->cm_fields['E'] = strdup(supplied_euid); } - if (references != NULL) { - if (!IsEmptyStr(references)) { - msg->cm_fields['W'] = strdup(references); - } + if ((references != NULL) && (!IsEmptyStr(references))) { + if (msg->cm_fields['W'] != NULL) + free(msg->cm_fields['W']); + msg->cm_fields['W'] = strdup(references); } if (preformatted_text != NULL) {