diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-02 18:44:43 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-02 18:44:43 +0800 |
commit | 1c6462e9fd157384d614ba9ce9dc24b6202c1197 (patch) | |
tree | fe89e6d58f064330052706d663fa31831e19df13 | |
parent | fb7fb662ca7005f294846c29cb936a61011336bc (diff) |
Fix ticket history member freeing
-rw-r--r-- | ticket.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -346,16 +346,14 @@ void rtclient_ticket_history(rtclient_ticket_history_list **listptr void rtclient_ticket_history_free(struct rtclient_ticket_history *history) { - if (history->attachments->length) { - for (size_t i = 0; i < history->attachments->length; i++) { - rtclient_ticket_history_attachment *attachment - = history->attachments->attachments[i]; - if (attachment->file_name) - free(attachment->file_name); - free(attachment); - } - free(history->attachments); + for (size_t i = 0; i < history->attachments->length; i++) { + rtclient_ticket_history_attachment *attachment + = history->attachments->attachments[i]; + if (attachment->file_name) + free(attachment->file_name); + free(attachment); } + free(history->attachments); free(history->created); free(history->creator); free(history->content); @@ -366,6 +364,8 @@ void rtclient_ticket_history_free(struct rtclient_ticket_history *history) free(history->new_value); if (history->old_value) free(history->old_value); + if (history->field) + free(history->field); free(history); history = NULL; } |