Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'native/org.eclipse.cdt.native.serial/jni/serial.c')
-rw-r--r--native/org.eclipse.cdt.native.serial/jni/serial.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/native/org.eclipse.cdt.native.serial/jni/serial.c b/native/org.eclipse.cdt.native.serial/jni/serial.c
index 5e783b61c7f..216169c041d 100644
--- a/native/org.eclipse.cdt.native.serial/jni/serial.c
+++ b/native/org.eclipse.cdt.native.serial/jni/serial.c
@@ -56,9 +56,11 @@ JNIEXPORT jlong JNICALL FUNC(open0)(JNIEnv *env, jobject jobj, jstring portName,
if (fd < 0) {
char msg[256];
sprintf(msg, "Error opening %s", cportName);
+ (*env)->ReleaseStringUTFChars(env, portName, cportName);
throwIOException(env, msg);
return fd;
}
+ (*env)->ReleaseStringUTFChars(env, portName, cportName);
// Turn off all flags
fcntl(fd, F_SETFL, 0);

Back to the top