Skip to content

Commit e10a7d8

Browse files
committed
JNI: release name string on error before returning NULL
1 parent 504d499 commit e10a7d8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

jni/jni_ecc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,7 @@ JNIEXPORT jobjectArray JNICALL Java_com_wolfssl_wolfcrypt_Ecc_wc_1ecc_1get_1curv
16111611
curveIdx = wc_ecc_get_curve_idx_from_name(name);
16121612
if (curveIdx < 0) {
16131613
LogStr("wc_ecc_get_curve_idx_from_name failed, idx: %d\n", curveIdx);
1614+
(*env)->ReleaseStringUTFChars(env, curveName, name);
16141615
throwWolfCryptExceptionFromError(env, curveIdx);
16151616
return NULL;
16161617
}

0 commit comments

Comments
 (0)