diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-14 07:22:00 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-14 07:22:00 +0800 |
commit | 4ccd288909c6a9f1fe47ae72744ffba6f0ef410e (patch) | |
tree | e050c2649fb54354884660ec3b4f0333375072d6 /rtclient.c | |
parent | e9561a9bd14469edab70886d98e050bfe054a3eb (diff) |
A function to free ticket list and its tickets
Diffstat (limited to 'rtclient.c')
-rw-r--r-- | rtclient.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -252,7 +252,7 @@ void rtclient_userget(rt_user **userptr, const char *name) request("/REST/1.0/user/", name, user_callback, (void *)userptr, NULL); } -void rtclient_search(rt_ticketlist **listptr, const char *query) +void rtclient_ticketssearch(rt_ticketlist **listptr, const char *query) { *listptr = malloc(sizeof(rt_ticketlist)); request("/REST/1.0/search/ticket?query=", query, search_callback @@ -286,6 +286,14 @@ void rtclient_userfree(rt_user *user) user = NULL; } +void rtclient_ticketsfree(rt_ticketlist *list) +{ + for (unsigned short i = 0; i < list->length; i++) + free(list->tickets[i]); + free(list); + list = NULL; +} + void rtclient_cleanup() { if (curl) { |