Move token buffers off the stack (Issue #117)

This commit is contained in:
Michael R Sweet
2025-04-04 21:20:23 -04:00
parent fe755eac3d
commit 0bd9edc845
4 changed files with 170 additions and 35 deletions

View File

@@ -110,6 +110,8 @@ pdfioFileClose(pdfio_file_t *pdf) // I - PDF file
{
bool ret = true; // Return value
size_t i; // Looping var
_pdfio_strbuf_t *current, // Current string buffer
*next; // Next string buffer
// Range check input
@@ -152,6 +154,12 @@ pdfioFileClose(pdfio_file_t *pdf) // I - PDF file
free(pdf->strings[i]);
free(pdf->strings);
for (current = pdf->strbuffers; current; current = next)
{
next = current->next;
free(current);
}
free(pdf);
return (ret);