iovec-util: add missing assertion
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user