From: Wilfried Goesgens Date: Mon, 19 Sep 2011 21:18:24 +0000 (+0000) Subject: Fix memory leaks in the networker X-Git-Tag: v8.01~25 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=482fe3b2b4e0d16b987e1353fc28abbcfc2c07a4;hp=a45b5c34772f51c4d2d6668a56db4d5f30944ad4 Fix memory leaks in the networker --- diff --git a/citadel/modules/network/serv_netmail.c b/citadel/modules/network/serv_netmail.c index e46a1dfde..90e4e6891 100644 --- a/citadel/modules/network/serv_netmail.c +++ b/citadel/modules/network/serv_netmail.c @@ -291,6 +291,8 @@ void network_spool_msg(long msgnum, char *pCh; StrBuf *Subject, *FlatSubject; + if (msg->cm_fields['K'] != NULL) + free(msg->cm_fields['K']); if (msg->cm_fields['V'] == NULL){ /* local message, no enVelope */ StrBuf *Buf; @@ -464,7 +466,7 @@ void network_spool_msg(long msgnum, */ for (nptr = sc->participates; nptr != NULL; nptr = nptr->next) { - if (msg->cm_fields['R'] == NULL) { + if (msg->cm_fields['R'] != NULL) { free(msg->cm_fields['R']); } msg->cm_fields['R'] = strdup(nptr->name);