X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=badbc8f7cc351e2bf6ab01e3e127289ba8285414;hb=08726130fc930fa8e434306eff1e3b73bcbdeb87;hp=2b09ed2b9fa71eb62753c853d34306dabbaa7198;hpb=b61d6a42b5f4a8561d73189e8c5726a2f5d34166;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 2b09ed2b9..badbc8f7c 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -532,7 +532,7 @@ int CtdlForEachMessage(int mode, long ref, char *search_string, int num_processed = 0; long thismsg; struct MetaData smi; - struct CtdlMessage *msg; + struct CtdlMessage *msg = NULL; int is_seen = 0; long lastold = 0L; int printed_lastold = 0; @@ -1109,7 +1109,11 @@ void CtdlFreeMessage(struct CtdlMessage *msg) { int i; - if (is_valid_message(msg) == 0) return; + if (is_valid_message(msg) == 0) + { + if (msg != NULL) free (msg); + return; + } for (i = 0; i < 256; ++i) if (msg->cm_fields[i] != NULL) { @@ -1902,7 +1906,7 @@ void cmd_msg2(char *cmdbuf) void cmd_msg3(char *cmdbuf) { long msgnum; - struct CtdlMessage *msg; + struct CtdlMessage *msg = NULL; struct ser_ret smr; if (CC->internal_pgm == 0) {