aboutsummaryrefslogtreecommitdiff
path: root/src/windows
diff options
context:
space:
mode:
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
}