summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftoepdf.cc6
2 files changed, 10 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index 13ab1e6e062..614e772c8f7 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,7 @@
+2018-06-12 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * pdftoepdf.cc: Free unused memory (w32 only).
+
2018-06-11 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* pdftoepdf.cc: Remove xfree(file_name) in order to avoid
diff --git a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
index eba6448ce77..7443e0249ae 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
+++ b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
@@ -167,10 +167,12 @@ static PdfDocument *find_add_document(char *file_name)
{
PdfDocument *p = pdfDocuments;
#ifdef _WIN32
+ int file_name_is_changed = 0;
wchar_t *fnamew;
if (file_system_codepage == CP_UTF8 && win32_codepage != CP_UTF8) {
fnamew = get_wstring_from_mbstring(CP_UTF8, file_name, fnamew=NULL);
file_name = get_mbstring_from_wstring(win32_codepage, fnamew, file_name=NULL);
+ file_name_is_changed = 1;
xfree(fnamew);
}
#endif
@@ -193,6 +195,10 @@ static PdfDocument *find_add_document(char *file_name)
p->inObjList = 0;
p->next = pdfDocuments;
pdfDocuments = p;
+#ifdef _WIN32
+ if (file_name_is_changed == 1)
+ xfree(file_name);
+#endif
return p;
}