mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 04:24:49 +02:00
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
This commit is contained in:
parent
d2e96c4350
commit
6a28f9e6fb
2 changed files with 15 additions and 3 deletions
|
@ -391,9 +391,16 @@ Java_sun_awt_windows_WCustomCursor_createCursorIndirect(
|
|||
|
||||
DASSERT(hCursor);
|
||||
|
||||
AwtCursor::setPData(self, ptr_to_jlong(new AwtCursor(env, hCursor, self, xHotSpot,
|
||||
yHotSpot, nW, nH, nSS, cols,
|
||||
(BYTE *)andMaskPtr)));
|
||||
try {
|
||||
AwtCursor::setPData(self, ptr_to_jlong(new AwtCursor(env, hCursor, self, xHotSpot,
|
||||
yHotSpot, nW, nH, nSS, cols,
|
||||
(BYTE *)andMaskPtr)));
|
||||
} catch (...) {
|
||||
if (cols) {
|
||||
delete[] cols;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
CATCH_BAD_ALLOC;
|
||||
}
|
||||
|
||||
|
|
|
@ -510,6 +510,11 @@ void AwtFont::LoadMetrics(JNIEnv *env, jobject fontMetrics)
|
|||
jobject font = env->GetObjectField(fontMetrics, AwtFont::fontID);
|
||||
AwtFont* awtFont = AwtFont::GetFont(env, font);
|
||||
|
||||
if (!awtFont) {
|
||||
/* failed to get font */
|
||||
return;
|
||||
}
|
||||
|
||||
HDC hDC = ::GetDC(0);
|
||||
DASSERT(hDC != NULL);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue