mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-31 05:05:32 +00:00
8214380: AwtDragSource function LoadCache misses a ReleaseLongArrayElements in special case
Reviewed-by: serb, stuefe
This commit is contained in:
parent
5f2062b484
commit
542ddf4f4d
@ -394,9 +394,12 @@ void AwtDragSource::LoadCache(jlongArray formats) {
|
||||
return;
|
||||
}
|
||||
|
||||
jboolean isCopy;
|
||||
jlong *lFormats = env->GetLongArrayElements(formats, &isCopy),
|
||||
jlong *lFormats = env->GetLongArrayElements(formats, 0),
|
||||
*saveFormats = lFormats;
|
||||
if (lFormats == NULL) {
|
||||
m_ntypes = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0, m_ntypes = 0; i < items; i++, lFormats++) {
|
||||
// Warning C4244.
|
||||
@ -422,6 +425,7 @@ void AwtDragSource::LoadCache(jlongArray formats) {
|
||||
m_types = (FORMATETC *)safe_Calloc(sizeof(FORMATETC), m_ntypes);
|
||||
} catch (std::bad_alloc&) {
|
||||
m_ntypes = 0;
|
||||
env->ReleaseLongArrayElements(formats, saveFormats, 0);
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user