Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorbjörn SVENSSON2019-09-03 11:33:47 -0400
committerTorbjörn SVENSSON2019-09-05 09:03:25 -0400
commit63e37acaac9fac9df9122ff7344491b14f430497 (patch)
treebcc28e08ac60c9a2fa2531e5e989ec61ca2bd660
parent764e42ef505e237923fab176041849b469decabc (diff)
downloadorg.eclipse.cdt-63e37acaac9fac9df9122ff7344491b14f430497.tar.gz
org.eclipse.cdt-63e37acaac9fac9df9122ff7344491b14f430497.tar.xz
org.eclipse.cdt-63e37acaac9fac9df9122ff7344491b14f430497.zip
Bug 550702: Fixed memory leak in SerialPort.open0()
Change-Id: I2bb1cd8c19addda7955886b8cb582d0effe64f4e Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
-rw-r--r--native/org.eclipse.cdt.native.serial/jni/serial.c2
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.sobin13408 -> 13408 bytes
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilibbin13756 -> 13756 bytes
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dllbin126038 -> 126038 bytes
4 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 5e783b61c7..216169c041 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);
diff --git a/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so b/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so
index 3b73b67c7a..268ae8165e 100755
--- a/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so
+++ b/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so
Binary files differ
diff --git a/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib b/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib
index 9904a21906..4676dd78dd 100755
--- a/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib
+++ b/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib
Binary files differ
diff --git a/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll b/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
index d2f654037b..e1c1019bfa 100755
--- a/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
+++ b/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
Binary files differ

Back to the top