coredump: move to _cleanup_ for destroying iovw object

This commit is contained in:
Lennart Poettering
2024-10-31 15:44:54 +01:00
parent 19455dd600
commit 2865561eaa
2 changed files with 25 additions and 43 deletions

View File

@@ -19,6 +19,10 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(struct iovec_wrapper*, iovw_free_free);
void iovw_free_contents(struct iovec_wrapper *iovw, bool free_vectors);
static inline void iovw_done_free(struct iovec_wrapper *iovw) {
iovw_free_contents(iovw, true);
}
int iovw_put(struct iovec_wrapper *iovw, void *data, size_t len);
static inline int iovw_consume(struct iovec_wrapper *iovw, void *data, size_t len) {
/* Move data into iovw or free on error */