summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hardware/dmidecode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hardware/dmidecode.c b/src/hardware/dmidecode.c
index a457db0..ca1070d 100644
--- a/src/hardware/dmidecode.c
+++ b/src/hardware/dmidecode.c
@@ -921,10 +921,10 @@ short dmi_get_memory(DmiMemory *memory)
/* Memory Module Bank Label and Slot ID */
buf = copy_string_part_after_delim(buffer[i], "Locator: ");
if (buf) {
- if (memory->modules[curr_mem].slot != -1) {
- continue;
- }
- if (strncasecmp(buf, "bank ", 5) != 0) {
+ if (memory->modules[curr_mem].slot != -1
+ || strncasecmp(buf, "bank ", 5) != 0) {
+ free(buf);
+ buf = NULL;
continue;
}
sscanf(buf, "%*s %d", &memory->modules[curr_mem].slot);