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:
@@ -1915,9 +1915,7 @@ int cg_get_keyed_attribute_full(
|
||||
r = -ENXIO;
|
||||
|
||||
fail:
|
||||
for (i = 0; i < n; i++)
|
||||
free(v[i]);
|
||||
|
||||
free_many_charp(v, n);
|
||||
return r;
|
||||
|
||||
done:
|
||||
|
||||
Reference in New Issue
Block a user