提交 3c4d1283 编写于 作者: P pchelko

8013454: [parfait] Memory leak in jdk/src/windows/native/sun/windows/awt_Cursor.cpp

8012079: [parfait] possible null pointer dereference in jdk/src/windows/native/sun/windows/awt_Font.cpp
Reviewed-by: art, serb
上级 721bb129
...@@ -391,9 +391,16 @@ Java_sun_awt_windows_WCustomCursor_createCursorIndirect( ...@@ -391,9 +391,16 @@ Java_sun_awt_windows_WCustomCursor_createCursorIndirect(
DASSERT(hCursor); DASSERT(hCursor);
AwtCursor::setPData(self, ptr_to_jlong(new AwtCursor(env, hCursor, self, xHotSpot, try {
yHotSpot, nW, nH, nSS, cols, AwtCursor::setPData(self, ptr_to_jlong(new AwtCursor(env, hCursor, self, xHotSpot,
(BYTE *)andMaskPtr))); yHotSpot, nW, nH, nSS, cols,
(BYTE *)andMaskPtr)));
} catch (...) {
if (cols) {
delete[] cols;
}
throw;
}
CATCH_BAD_ALLOC; CATCH_BAD_ALLOC;
} }
......
...@@ -510,6 +510,11 @@ void AwtFont::LoadMetrics(JNIEnv *env, jobject fontMetrics) ...@@ -510,6 +510,11 @@ void AwtFont::LoadMetrics(JNIEnv *env, jobject fontMetrics)
jobject font = env->GetObjectField(fontMetrics, AwtFont::fontID); jobject font = env->GetObjectField(fontMetrics, AwtFont::fontID);
AwtFont* awtFont = AwtFont::GetFont(env, font); AwtFont* awtFont = AwtFont::GetFont(env, font);
if (!awtFont) {
/* failed to get font */
return;
}
HDC hDC = ::GetDC(0); HDC hDC = ::GetDC(0);
DASSERT(hDC != NULL); DASSERT(hDC != NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册