Fix some memory leaks (Issue #23)

This commit is contained in:
Michael R Sweet
2021-10-16 00:02:31 -04:00
parent f3689d6b3d
commit 095a4c10d4
5 changed files with 34 additions and 10 deletions

View File

@@ -357,6 +357,15 @@ _pdfioArrayDebug(pdfio_array_t *a, // I - Array
void
_pdfioArrayDelete(pdfio_array_t *a) // I - Array
{
size_t i; // Looping var
for (i = 0; i < a->num_values; i ++)
{
if (a->values[i].type == PDFIO_VALTYPE_BINARY)
free(a->values[i].value.binary.data);
}
if (a)
free(a->values);