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

Commit

Permalink
fix heap-use-after-free in scala (#15503)
Browse files Browse the repository at this point in the history
* fix heap-use-after-free

* trigger CI
  • Loading branch information
arcadiaphy authored and zachgk committed Jul 15, 2019
1 parent 6acf7e6 commit b88705e
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit b88705e

Please sign in to comment.