- if (mr->uncorrected_err_total > 0 || mr->uncorrected_err_timed > 0) {
- if (plugin_notification_meta_add_signed_int(
- &n, MCELOG_UNCORRECTED_ERR, mr->uncorrected_err_total) < 0) {
- ERROR(MCELOG_PLUGIN ": add uncorrected errors meta data failed");
- plugin_notification_meta_free(n.meta);
- return (-1);
- }
- if (plugin_notification_meta_add_signed_int(
- &n, "uncorrected memory timed errors",
- mr->uncorrected_err_timed) < 0) {
- ERROR(MCELOG_PLUGIN ": add uncorrected timed errors meta data failed");
- plugin_notification_meta_free(n.meta);
- return (-1);
- }
- ssnprintf(n.message, sizeof(n.message), "Uncorrected Memory Errors");
- sstrncpy(n.type_instance, MCELOG_UNCORRECTED_ERR_TYPE_INS,
- sizeof(n.type_instance));
- n.severity = NOTIF_FAILURE;
- plugin_dispatch_notification(&n);
-
- if (n.meta)
- plugin_notification_meta_free(n.meta);
- }
+ plugin_notification_meta_add_signed_int(&n, MCELOG_UNCORRECTED_ERR,
+ mr->uncorrected_err_total);
+ plugin_notification_meta_add_signed_int(&n, MCELOG_UNCORRECTED_ERR_TIMED,
+ mr->uncorrected_err_timed);
+ snprintf(n.message, sizeof(n.message), MCELOG_UNCORRECTED_ERR);
+ sstrncpy(n.type_instance, MCELOG_UNCORRECTED_ERR_TYPE_INS,
+ sizeof(n.type_instance));
+ n.severity = NOTIF_FAILURE;
+ plugin_dispatch_notification(&n);
+ if (n.meta)
+ plugin_notification_meta_free(n.meta);
+ n.meta = NULL;