projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
90bad6f
)
fix possible leaks around 'W'; the funambol code abuses it.
author
Wilfried Goesgens
<dothebart@citadel.org>
Mon, 19 Sep 2011 21:19:12 +0000
(21:19 +0000)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Mon, 19 Sep 2011 21:33:04 +0000
(21:33 +0000)
citadel/msgbase.c
patch
|
blob
|
history
diff --git
a/citadel/msgbase.c
b/citadel/msgbase.c
index 2299d9a481fe37226aed7e6891f6fe03a5be8448..1bff449e2f9002fbaf70bd690fe757eeec98b2bb 100644
(file)
--- a/
citadel/msgbase.c
+++ b/
citadel/msgbase.c
@@
-3230,8
+3230,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) {
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);
CtdlMailboxName(actual_rm, sizeof actual_rm, &userbuf, MAILROOM);
CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0, msg);
CtdlBumpNewMailCounter(userbuf.usernum);
@@
-3858,10
+3856,10
@@
struct CtdlMessage *CtdlMakeMessage(
msg->cm_fields['E'] = strdup(supplied_euid);
}
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) {
}
if (preformatted_text != NULL) {