From b0c4961901a5822d831613e6cc8a24b10d1a4746 Mon Sep 17 00:00:00 2001 From: Dave West Date: Wed, 13 Feb 2008 21:33:37 +0000 Subject: [PATCH] Fixed a small bug in serv_vcard.c that could leave the cm_fields['E'] initialised to an invalid pointer. --- citadel/modules/vcard/serv_vcard.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/citadel/modules/vcard/serv_vcard.c b/citadel/modules/vcard/serv_vcard.c index 8458670ad..d4ab858b9 100644 --- a/citadel/modules/vcard/serv_vcard.c +++ b/citadel/modules/vcard/serv_vcard.c @@ -610,7 +610,11 @@ int vcard_upload_beforesave(struct CtdlMessage *msg) { /* * Set the EUID of the message to the UID of the vCard. */ - if (msg->cm_fields['E'] != NULL) free(msg->cm_fields['E']); + if (msg->cm_fields['E'] != NULL) + { + free(msg->cm_fields['E']); + msg->cm_fields['E'] = NULL; + } s = vcard_get_prop(v, "UID", 0, 0, 0); if (s != NULL) { msg->cm_fields['E'] = strdup(s); -- 2.30.2