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
+2 -2
View File
@@ -50,13 +50,13 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
}
int setrlimit_closest_all(const struct rlimit *const *rlim, int *which_failed) {
int i, r;
int r;
assert(rlim);
/* On failure returns the limit's index that failed in *which_failed, but only if non-NULL */
for (i = 0; i < _RLIMIT_MAX; i++) {
for (int i = 0; i < _RLIMIT_MAX; i++) {
if (!rlim[i])
continue;