changeset 13339:5ba4548478b8

8205356: Choose printer defaults Reviewed-by: prr, mschoene, rhalade
author psadhukhan
date Tue, 21 Aug 2018 11:43:03 +0530
parents 776a933c85ea
children f8279bb6639f
files src/windows/native/sun/windows/WPrinterJob.cpp
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/windows/WPrinterJob.cpp	Sat Aug 18 13:03:47 2018 +0100
+++ b/src/windows/native/sun/windows/WPrinterJob.cpp	Tue Aug 21 11:43:03 2018 +0530
@@ -886,10 +886,12 @@
               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
   }