mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
io-util: introduce iovec_array_free()
It will be used in later commits.
This commit is contained in:
parent
dcef5e293f
commit
253a83ea44
|
@ -362,3 +362,13 @@ size_t iovw_size(struct iovec_wrapper *iovw) {
|
|||
|
||||
return n;
|
||||
}
|
||||
|
||||
void iovec_array_free(struct iovec *iov, size_t n) {
|
||||
if (!iov)
|
||||
return;
|
||||
|
||||
for (size_t i = 0; i < n; i++)
|
||||
free(iov[i].iov_base);
|
||||
|
||||
free(iov);
|
||||
}
|
||||
|
|
|
@ -105,3 +105,5 @@ int iovw_put_string_field(struct iovec_wrapper *iovw, const char *field, const c
|
|||
int iovw_put_string_field_free(struct iovec_wrapper *iovw, const char *field, char *value);
|
||||
void iovw_rebase(struct iovec_wrapper *iovw, char *old, char *new);
|
||||
size_t iovw_size(struct iovec_wrapper *iovw);
|
||||
|
||||
void iovec_array_free(struct iovec *iov, size_t n);
|
||||
|
|
Loading…
Reference in a new issue