summaryrefslogtreecommitdiff
path: root/coders/pdf.c
diff options
context:
space:
mode:
Diffstat (limited to 'coders/pdf.c')
-rw-r--r--coders/pdf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/coders/pdf.c b/coders/pdf.c
index 38613a3f4..f82d7c005 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -567,6 +567,7 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
file=AcquireUniqueFileResource(postscript_filename);
if (file == -1)
{
+ (void) RelinquishUniqueFileResource(input_filename);
ThrowFileException(exception,FileOpenError,"UnableToCreateTemporaryFile",
image_info->filename);
CleanupPDFInfo(&pdf_info);
@@ -576,6 +577,7 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (write(file," ",1) != 1)
{
file=close(file)-1;
+ (void) RelinquishUniqueFileResource(input_filename);
(void) RelinquishUniqueFileResource(postscript_filename);
CleanupPDFInfo(&pdf_info);
image=DestroyImage(image);
@@ -594,6 +596,7 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
delegate_info=GetDelegateInfo("ps:alpha",(char *) NULL,exception);
if (delegate_info == (const DelegateInfo *) NULL)
{
+ (void) RelinquishUniqueFileResource(input_filename);
(void) RelinquishUniqueFileResource(postscript_filename);
CleanupPDFInfo(&pdf_info);
image=DestroyImage(image);