aboutsummaryrefslogtreecommitdiff
path: root/src/windows
diff options
context:
space:
mode:
authorpsadhukhan <unknown>2018-08-21 11:43:03 +0530
committerbell-sw <liberica@bell-sw.com>2019-02-13 13:56:18 +0300
commit1c3653b26600f9d8f5317bb45b24ea49e4f862a3 (patch)
treea39d1ff43cb4297c0c0d6ccfbb59c966b4b82cb6 /src/windows
parenta25483c8a0afee34ca429d07b073d88d9494e4b3 (diff)
downloadjdk8u_jdk-1c3653b26600f9d8f5317bb45b24ea49e4f862a3.tar.gz
8205356: Choose printer defaults
Reviewed-by: prr, mschoene, rhalade
Diffstat (limited to 'src/windows')
-rw-r--r--src/windows/native/sun/windows/WPrinterJob.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/windows/native/sun/windows/WPrinterJob.cpp b/src/windows/native/sun/windows/WPrinterJob.cpp
index 3761c60dd1..70aaa74236 100644
--- a/src/windows/native/sun/windows/WPrinterJob.cpp
+++ b/src/windows/native/sun/windows/WPrinterJob.cpp
@@ -886,10 +886,12 @@ Java_sun_print_Win32PrintService_getDefaultSettings(JNIEnv *env,
if (!present) {
defIndices[0] = papers[0];
}
- if (papers != NULL) {
- free((char*)papers);
- }
}
+ // If DeviceCapabilities fails, then also free paper allocation
+ if (papers != NULL) {
+ free((char*)papers);
+ }
+
}
RESTORE_CONTROLWORD
}