mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +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:
parent
764e42ef50
commit
63e37acaac
4 changed files with 2 additions and 0 deletions
|
@ -56,9 +56,11 @@ JNIEXPORT jlong JNICALL FUNC(open0)(JNIEnv *env, jobject jobj, jstring portName,
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
char msg[256];
|
char msg[256];
|
||||||
sprintf(msg, "Error opening %s", cportName);
|
sprintf(msg, "Error opening %s", cportName);
|
||||||
|
(*env)->ReleaseStringUTFChars(env, portName, cportName);
|
||||||
throwIOException(env, msg);
|
throwIOException(env, msg);
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
(*env)->ReleaseStringUTFChars(env, portName, cportName);
|
||||||
|
|
||||||
// Turn off all flags
|
// Turn off all flags
|
||||||
fcntl(fd, F_SETFL, 0);
|
fcntl(fd, F_SETFL, 0);
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue