Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cff49041 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "CameraMetadataNative: Fix FD leak in dump."

parents eff8ed36 7f63b9a9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -442,10 +442,12 @@ static void CameraMetadata_dump(JNIEnv *env, jobject thiz) {

        if (threadRet != 0) {
            close(writeFd);
            close(readFd);

            jniThrowExceptionFmt(env, "java/io/IOException",
                    "Failed to create thread for writing (errno = %#x, message = '%s')",
                    threadRet, strerror(threadRet));
            return;
        }
    }

@@ -476,6 +478,8 @@ static void CameraMetadata_dump(JNIEnv *env, jobject thiz) {
        } else if (!logLine.isEmpty()) {
            ALOGD("%s", logLine.string());
        }

        close(readFd);
    }

    int res;