Route all access to cm_fields[] through api functions
[citadel.git] / citadel / modules / clamav / serv_virus.c
index c4b8a5d4fe05c2111f96e3bed48d8cc75bfbc736..ae24461aa028b491f8174dd6faea08d2fadcdbd5 100644 (file)
@@ -180,10 +180,7 @@ int clamd(struct CtdlMessage *msg) {
        }
 
        if (is_virus) {
-               if (msg->cm_fields['0'] != NULL) {
-                       free(msg->cm_fields['0']);
-               }
-               msg->cm_fields['0'] = strdup("message rejected by virus filter");
+               CM_SetField(msg, eErrorMsg, HKEY("message rejected by virus filter"));
        }
 
 bail:  close(sock);