diff --git a/include/mastodont_relationship.h b/include/mastodont_relationship.h index 4dfb10d..64a390c 100644 --- a/include/mastodont_relationship.h +++ b/include/mastodont_relationship.h @@ -60,4 +60,6 @@ int mastodont_get_relationships(mastodont_t* data, struct mstdnt_relationship* relationships[], size_t* size); +void mstdnt_cleanup_relationships(struct mstdnt_relationship* rels); + #endif /* MASTODONT_RELATIONSHIP_H */ diff --git a/src/relationship.c b/src/relationship.c index 5b5452b..0960803 100644 --- a/src/relationship.c +++ b/src/relationship.c @@ -143,3 +143,9 @@ int mastodont_get_relationships(mastodont_t* data, return mastodont_request(data, &req_args); } + +void mstdnt_cleanup_relationships(struct mstdnt_relationship* rels) +{ + if (!rels) return; + free(rels); +}