From c4d27915da7677964c84992c1e34c31ad3a281eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Wed, 2 Oct 2019 18:58:01 +0800 Subject: Ticket history attachment list gets resized according to the length --- ticket.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ticket.c b/ticket.c index d900354..34fd7bb 100644 --- a/ticket.c +++ b/ticket.c @@ -287,6 +287,15 @@ static size_t history_l_handler(void *contents, size_t size, size_t nmemb size_t i = 0; while (strcmp(line, "--")) { i = ticket_history->attachments->length++; + rtclient_ticket_history_attachment_list *ptr + = realloc(ticket_history->attachments + , sizeof(ticket_history + ->attachments) + + ticket_history + ->attachments->length + * sizeof + (rtclient_ticket_history_attachment)); + ticket_history->attachments = ptr; ticket_history->attachments->attachments[i] = malloc (sizeof -- cgit v1.2.3