treewide: tighten variable scope in loops (#18372)

Also use _cleanup_free_ in one more place.
This commit is contained in:
Susant Sahani
2021-01-27 08:19:39 +01:00
committed by GitHub
parent 37baf8db56
commit fe96c0f86d
30 changed files with 74 additions and 127 deletions
+1 -2
View File
@@ -159,10 +159,9 @@ static int detect_vm_dmi(void) {
/* https://wiki.freebsd.org/bhyve */
{ "BHYVE", VIRTUALIZATION_BHYVE },
};
unsigned i;
int r;
for (i = 0; i < ELEMENTSOF(dmi_vendors); i++) {
for (size_t i = 0; i < ELEMENTSOF(dmi_vendors); i++) {
_cleanup_free_ char *s = NULL;
unsigned j;