Merge pull request #30417 from YHNdnzj/unit-log-resource

core/unit: clean up unit_log_resources
This commit is contained in:
Luca Boccassi
2023-12-14 08:45:26 +00:00
committed by GitHub
5 changed files with 114 additions and 216 deletions
+4 -2
View File
@@ -62,8 +62,10 @@ char* set_iovec_string_field_free(struct iovec *iovec, size_t *n_iovec, const ch
return x;
}
void iovec_array_free(struct iovec *iovec, size_t n) {
FOREACH_ARRAY(i, iovec, n)
void iovec_array_free(struct iovec *iovec, size_t n_iovec) {
assert(iovec || n_iovec == 0);
FOREACH_ARRAY(i, iovec, n_iovec)
free(i->iov_base);
free(iovec);
+1 -1
View File
@@ -41,4 +41,4 @@ static inline bool iovec_is_set(const struct iovec *iovec) {
char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value);
char* set_iovec_string_field_free(struct iovec *iovec, size_t *n_iovec, const char *field, char *value);
void iovec_array_free(struct iovec *iovec, size_t n);
void iovec_array_free(struct iovec *iovec, size_t n_iovec);