HADOOP-17209. Erasure Coding: Native library memory leak. Contributed by Sean Chow

(cherry picked from commit 17cd8a1b16)
This commit is contained in:
S O'Donnell 2020-08-24 11:24:31 +01:00
parent 4ab14692e6
commit 4163b43a83
2 changed files with 4 additions and 1 deletions

View File

@ -92,6 +92,7 @@ void getInputs(JNIEnv *env, jobjectArray inputs, jintArray inputOffsets,
destInputs[i] = NULL;
}
}
(*env)->ReleaseIntArrayElements(env, inputOffsets, tmpInputOffsets, 0);
}
void getOutputs(JNIEnv *env, jobjectArray outputs, jintArray outputOffsets,
@ -112,4 +113,5 @@ void getOutputs(JNIEnv *env, jobjectArray outputs, jintArray outputOffsets,
byteBuffer));
destOutputs[i] += tmpOutputOffsets[i];
}
(*env)->ReleaseIntArrayElements(env, outputOffsets, tmpOutputOffsets, 0);
}

View File

@ -66,6 +66,7 @@ jintArray outputOffsets) {
decode(&rsDecoder->decoder, rsDecoder->inputs, tmpErasedIndexes,
numErased, rsDecoder->outputs, chunkSize);
(*env)->ReleaseIntArrayElements(env, erasedIndexes, tmpErasedIndexes, 0);
}
JNIEXPORT void JNICALL