diff --git a/include/mastodont.h b/include/mastodont.h index 8d8f837..fe2b8e4 100644 --- a/include/mastodont.h +++ b/include/mastodont.h @@ -58,6 +58,6 @@ void mstdnt_cleanup(mastodont_t* data); */ void mstdnt_storage_cleanup(struct mstdnt_storage* storage); -void mstdnt_request_cb_cleanup(mstdnt_request_cb_t* data); +void mstdnt_request_cb_cleanup(mstdnt_request_cb_data* data); #endif /* MASTODONT_H */ diff --git a/src/mastodont.c b/src/mastodont.c index 0bd8100..0f61c50 100644 --- a/src/mastodont.c +++ b/src/mastodont.c @@ -34,7 +34,10 @@ void mstdnt_storage_cleanup(struct mstdnt_storage* storage) } } -void mstdnt_request_cb_cleanup(mstdnt_request_cb_t* data) +void mstdnt_request_cb_cleanup(mstdnt_request_cb_data* data) { - + mstdnt_storage_cleanup(data->storage); + free(data->storage); + data->data_free_cb(data->data); + free(data); } diff --git a/src/request.c b/src/request.c index 9ee0602..a56b900 100644 --- a/src/request.c +++ b/src/request.c @@ -165,5 +165,5 @@ cleanup: /* Only free if params_query set */ if (args->params_query) mstdnt_free(url_query); - return res; + return 1; }