From 0c3f34c37279b4690694c2097230bf28dcac78e4 Mon Sep 17 00:00:00 2001 From: prr Date: Tue, 9 May 2017 13:28:14 -0700 Subject: [PATCH] 8179536: Cleaner print job handling Reviewed-by: serb, mschoene, rhalade --- src/windows/native/sun/windows/WPrinterJob.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/windows/native/sun/windows/WPrinterJob.cpp b/src/windows/native/sun/windows/WPrinterJob.cpp index 11a6b4b87..3761c60dd 100644 --- a/src/windows/native/sun/windows/WPrinterJob.cpp +++ b/src/windows/native/sun/windows/WPrinterJob.cpp @@ -508,14 +508,14 @@ jobjectArray getAllDCNames(JNIEnv *env, jobject peer, jstring printer, names = env->NewObjectArray(cReturned, cls, NULL); } if (names == NULL || cls == NULL) { - delete buf; + delete[] buf; return names; } for (int i = 0; i < cReturned; i++) { utf_str = JNU_NewStringPlatform(env, buf+(buf_len*i)); if (utf_str == NULL) { - delete buf; + delete[] buf; return names; } env->SetObjectArrayElement(names, i, utf_str); -- GitLab