Fixing a leak in OnnxSequences with String keys or values. (#6473)

This commit is contained in:
Adam Pocock 2021-01-28 14:28:56 -05:00 committed by GitHub
parent d850fa63bf
commit 77d0eb3f56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Licensed under the MIT License.
*/
#include <jni.h>
@ -28,6 +28,7 @@ JNIEXPORT jobjectArray JNICALL Java_ai_onnxruntime_OnnxSequence_getStringKeys
jobjectArray output = createStringArrayFromTensor(jniEnv, api, allocator, keys);
api->ReleaseValue(keys);
api->ReleaseValue(element);
return output;
}
@ -80,6 +81,7 @@ JNIEXPORT jobjectArray JNICALL Java_ai_onnxruntime_OnnxSequence_getStringValues
jobjectArray output = createStringArrayFromTensor(jniEnv, api, allocator, values);
api->ReleaseValue(values);
api->ReleaseValue(element);
return output;
}