rlimit-util: add a common destructor call for arrays of struct rlimit
This commit is contained in:
@@ -324,3 +324,13 @@ int rlimit_from_string_harder(const char *s) {
|
||||
|
||||
return rlimit_from_string(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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user