alloc-util: add free_many() helper
We often free an array of things. Let's create a common helper for this, and port some potential users over. (Not all, too lazy for that for now).
This commit is contained in:
@@ -359,13 +359,7 @@ int rlimit_from_string_harder(const char *s) {
|
||||
}
|
||||
|
||||
void rlimit_free_all(struct rlimit **rl) {
|
||||
int i;
|
||||
|
||||
if (!rl)
|
||||
return;
|
||||
|
||||
for (i = 0; i < _RLIMIT_MAX; i++)
|
||||
rl[i] = mfree(rl[i]);
|
||||
free_many((void**) rl, _RLIMIT_MAX);
|
||||
}
|
||||
|
||||
int rlimit_nofile_bump(int limit) {
|
||||
|
||||
Reference in New Issue
Block a user