diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2015-01-27 17:06:13 -0800 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2015-01-27 17:06:13 -0800 |
commit | 15f13d88d20917138d6e6cb38df6341f6b676cf6 (patch) | |
tree | b4acdcb7dd993aa9e118117efe5009ac3a4a61b2 /platform/windows/gsprint | |
parent | 7f231b336da00ab5f6fbf0849d591545632856e1 (diff) | |
download | mupdf-15f13d88d20917138d6e6cb38df6341f6b676cf6.tar.xz |
Fix mismatching allocation and deallocation issues.
The form of delete should match the form that is used in the new command.
Otherwise the behavior is undefined.
Diffstat (limited to 'platform/windows/gsprint')
-rw-r--r-- | platform/windows/gsprint/gsprint.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/windows/gsprint/gsprint.cpp b/platform/windows/gsprint/gsprint.cpp index 813364a8..4f4a3924 100644 --- a/platform/windows/gsprint/gsprint.cpp +++ b/platform/windows/gsprint/gsprint.cpp @@ -30,7 +30,7 @@ SYMBOL_DECLSPEC int __stdcall ShowPropertiesDialog(void *hptr, void *printername if (!OpenPrinter(output, &hPrinter, NULL)) { - free(output); + delete[] output; return FAIL; } @@ -39,7 +39,7 @@ SYMBOL_DECLSPEC int __stdcall ShowPropertiesDialog(void *hptr, void *printername pDevMode = (LPDEVMODE)malloc(dwNeeded); if (pDevMode == NULL) { - free(output); + delete[] output; ClosePrinter(hPrinter); return FAIL; } @@ -53,7 +53,7 @@ SYMBOL_DECLSPEC int __stdcall ShowPropertiesDialog(void *hptr, void *printername dwRet = DocumentProperties(hWnd, hPrinter, output, pDevMode, NULL, fMode); if (dwRet != IDOK) { - free(output); + delete[] output; ClosePrinter(hPrinter); free(pDevMode); return FAIL; @@ -67,7 +67,7 @@ SYMBOL_DECLSPEC int __stdcall ShowPropertiesDialog(void *hptr, void *printername /* Clean up */ free(pDevMode); - free(output); + delete[] output; ClosePrinter(hPrinter); return 0; } |