Skip to content

Commit 274c36e

Browse files
use '0' when releasing array
1 parent fef8685 commit 274c36e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

native/com_wolfssl_WolfSSLSession.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,9 @@ JNIEXPORT jint JNICALL Java_com_wolfssl_WolfSSLSession_read(JNIEnv* jenv,
730730

731731
} while (err == SSL_ERROR_WANT_WRITE || err == SSL_ERROR_WANT_READ);
732732

733-
(*jenv)->ReleaseByteArrayElements(jenv, raw, (jbyte*)data, JNI_COMMIT);
733+
/* JNI_COMMIT commits the data but does not free the local array
734+
* 0 is used here to both commit and free */
735+
(*jenv)->ReleaseByteArrayElements(jenv, raw, (jbyte*)data, 0);
734736
}
735737

736738
return size;

0 commit comments

Comments
 (0)