From eaad95a07af1bccc85b0283fe060e2790c3eb824 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Tue, 5 Apr 2022 03:30:54 +0000 Subject: [PATCH] Cleanup relationships function FossilOrigin-Name: fa605e90ee89abef5bbe42be95e091c70a2e55446bd6262adefb1c3a8802f853 --- include/mastodont_relationship.h | 2 ++ src/relationship.c | 6 ++++++ 2 files changed, 8 insertions(+) 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); +}