io-util: introduce iovec_array_free()
It will be used in later commits.
This commit is contained in:
committed by
Yu Watanabe
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);
|
||||
|
||||
Reference in New Issue
Block a user