Skip to content

Commit

Permalink
util/cleanup: Add cleanup for struct nvme_fabrics_uri
Browse files Browse the repository at this point in the history
libnvme cleanup definitions are not part of public API.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
  • Loading branch information
tbzatek committed May 17, 2024
1 parent c5d7cd1 commit 4def0b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util/cleanup.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,12 @@ static inline void cleanup_nvme_root(nvme_root_t *r)
}
#define _cleanup_nvme_root_ __cleanup__(cleanup_nvme_root)

static inline void free_uri(struct nvme_fabrics_uri **uri)
{
if (*uri)
nvme_free_uri(*uri);
}

#define _cleanup_uri_ __cleanup__(free_uri)

#endif

0 comments on commit 4def0b6

Please sign in to comment.