mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-23 11:54:33 +00:00
Fix a use after free()
The issue was reported by Coverity Scan. Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
1 parent
1c48b191c8
commit
3b548b74ae
1 file changed
+2
-2
@@ -48,7 +48,6 @@ void print_chip_raw(const sensors_chip_name *name)
|
||||
continue;
|
||||
}
|
||||
printf("%s:\n", label);
|
||||
free(label);
|
||||
|
||||
b = 0;
|
||||
while ((sub = sensors_get_all_subfeatures(name, feature, &b))) {
|
||||
@@ -64,6 +63,7 @@ void print_chip_raw(const sensors_chip_name *name)
|
||||
} else
|
||||
printf("(%s)\n", label);
|
||||
}
|
||||
free(label);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,6 @@ void print_chip_json(const sensors_chip_name *name)
|
||||
if (cnt > 0)
|
||||
printf(",\n");
|
||||
printf(" \"%s\":{\n", label);
|
||||
free(label);
|
||||
|
||||
b = 0;
|
||||
subCnt = 0;
|
||||
@@ -109,6 +108,7 @@ void print_chip_json(const sensors_chip_name *name)
|
||||
}
|
||||
subCnt++;
|
||||
}
|
||||
free(label);
|
||||
printf("\n }");
|
||||
cnt++;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user