diff --git a/src/windows/native/sun/windows/WPrinterJob.cpp b/src/windows/native/sun/windows/WPrinterJob.cpp index 11a6b4b8734c06ad9dcaea60201ef1591b0d431f..3761c60dd1a4948f22af59c91cb987c2eed5557b 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);