summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-10-02 18:44:43 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-10-02 18:44:43 +0800
commit1c6462e9fd157384d614ba9ce9dc24b6202c1197 (patch)
treefe89e6d58f064330052706d663fa31831e19df13
parentfb7fb662ca7005f294846c29cb936a61011336bc (diff)
Fix ticket history member freeing
-rw-r--r--ticket.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ticket.c b/ticket.c
index 7440693..d900354 100644
--- a/ticket.c
+++ b/ticket.c
@@ -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;
}