Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

fix heap-use-after-free in scala #15503

Merged
merged 2 commits into from
Jul 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,6 @@ JNIEXPORT jint JNICALL Java_org_apache_mxnet_LibInfo_mxImperativeInvokeEx
cParamVals,
&cOutStypes);
env->ReleaseLongArrayElements(inputs, cInputs, 0);
if (cOutputsGiven) {
env->ReleaseLongArrayElements(outputsGiven, cOutputsGiven, 0);
}

// release allocated memory
if (numParams > 0) {
Expand Down Expand Up @@ -284,6 +281,10 @@ JNIEXPORT jint JNICALL Java_org_apache_mxnet_LibInfo_mxImperativeInvokeEx
}
}

if (cOutputsGiven) {
env->ReleaseLongArrayElements(outputsGiven, cOutputsGiven, 0);
}

return ret;
}

Expand Down