- mcelog_memory_rec_t mr) {
- if (n == NULL)
- return (-1);
-
- if (plugin_notification_meta_add_string(n, MCELOG_SOCKET_STR, mr.location) <
- 0) {
- ERROR("%s: add memory location meta data failed", MCELOG_PLUGIN);
- return (-1);
+ const mcelog_memory_rec_t *mr) {
+ if (n == NULL || mr == NULL)
+ return -1;
+
+ if ((mr->location[0] != '\0') &&
+ (plugin_notification_meta_add_string(n, MCELOG_SOCKET_STR, mr->location) <
+ 0)) {
+ ERROR(MCELOG_PLUGIN ": add memory location meta data failed");
+ return -1;
+ }
+ if ((mr->dimm_name[0] != '\0') &&
+ (plugin_notification_meta_add_string(n, MCELOG_DIMM_NAME, mr->dimm_name) <
+ 0)) {
+ ERROR(MCELOG_PLUGIN ": add DIMM name meta data failed");
+ plugin_notification_meta_free(n->meta);
+ return -1;