Fixed a small bug in serv_vcard.c that could leave the cm_fields['E']
[citadel.git] / citadel / modules / vcard / serv_vcard.c
index 8458670ad9f7875a059154ee54a53c57fb0dba8c..d4ab858b9407d8fb45695801648228dac5fad73b 100644 (file)
@@ -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);