summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'devices/vector/gdevpdfo.c')
-rw-r--r--devices/vector/gdevpdfo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/devices/vector/gdevpdfo.c b/devices/vector/gdevpdfo.c
index 402d290c..70b66c6b 100644
--- a/devices/vector/gdevpdfo.c
+++ b/devices/vector/gdevpdfo.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2019 Artifex Software, Inc.
+/* Copyright (C) 2001-2020 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1132,6 +1132,10 @@ static int write_key_as_string_encrypted(const gx_device_pdf *pdev, const byte *
memcpy(buffer, str, size);
s_arcfour_process_buffer(&sarc4, buffer, size);
stream_write(&sout, buffer, size);
+ /* Another case where we use sclose() and not s_close_filters(), because the
+ * buffer we supplied to s_init_filter is a heap based C object, so we
+ * must not free it.
+ */
sclose(&sout); /* Writes ')'. */
gs_free_object(pdev->pdf_memory, buffer, "Free encryption buffer");
return 0;