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

This commit is contained in:
S O'Donnell 2020-08-24 11:24:31 +01:00
parent 5c927eb550
commit 17cd8a1b16
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; destInputs[i] = NULL;
} }
} }
(*env)->ReleaseIntArrayElements(env, inputOffsets, tmpInputOffsets, 0);
} }
void getOutputs(JNIEnv *env, jobjectArray outputs, jintArray outputOffsets, void getOutputs(JNIEnv *env, jobjectArray outputs, jintArray outputOffsets,
@ -112,4 +113,5 @@ void getOutputs(JNIEnv *env, jobjectArray outputs, jintArray outputOffsets,
byteBuffer)); byteBuffer));
destOutputs[i] += tmpOutputOffsets[i]; destOutputs[i] += tmpOutputOffsets[i];
} }
(*env)->ReleaseIntArrayElements(env, outputOffsets, tmpOutputOffsets, 0);
} }

View File

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