changeset 53340:827db73f2d6a

8205360: Choose printer defaults Reviewed-by: prr, mschoene, rhalade
author psadhukhan
date Tue, 31 Jul 2018 11:43:24 +0530
parents c66b192fe3b4
children 3d4e47348142
files src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp	Thu Jul 19 15:23:06 2018 -0700
+++ b/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp	Tue Jul 31 11:43:24 2018 +0530
@@ -962,9 +962,10 @@
               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