1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 09:16:02 +02:00

Bug 550702: Fixed memory leak in SerialPort.open0()

Change-Id: I2bb1cd8c19addda7955886b8cb582d0effe64f4e
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
This commit is contained in:
Torbjörn SVENSSON 2019-09-03 17:33:47 +02:00
parent 764e42ef50
commit 63e37acaac
4 changed files with 2 additions and 0 deletions

View file

@ -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);