Loading core/jni/android/graphics/BitmapFactory.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -551,7 +551,7 @@ static jobject nativeDecodeFileDescriptor(JNIEnv* env, jobject clazz, jobject fi // if we only close the file descriptor and not the file object it is used to // create. If we don't explicitly clean up the file (which in turn closes the // descriptor) the buffers allocated internally by fseek will be leaked. int dupDescriptor = dup(descriptor); int dupDescriptor = fcntl(descriptor, F_DUPFD_CLOEXEC, 0); FILE* file = fdopen(dupDescriptor, "r"); if (file == NULL) { Loading core/jni/android/graphics/ImageDecoder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ static jobject ImageDecoder_nCreateFd(JNIEnv* env, jobject /*clazz*/, "broken file descriptor; fstat returned -1", nullptr, source); } int dupDescriptor = dup(descriptor); int dupDescriptor = fcntl(descriptor, F_DUPFD_CLOEXEC, 0); FILE* file = fdopen(dupDescriptor, "r"); if (file == NULL) { close(dupDescriptor); Loading core/jni/android_content_res_ApkAssets.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ static jlong NativeLoadFromFd(JNIEnv* env, jclass /*clazz*/, jobject file_descri return 0; } unique_fd dup_fd(::dup(fd)); unique_fd dup_fd(::fcntl(fd, F_DUPFD_CLOEXEC, 0)); if (dup_fd < 0) { jniThrowIOException(env, errno); return 0; Loading core/jni/android_ddm_DdmHandleNativeHeap.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ struct Header { namespace android { static void ReadFile(const char* path, String8& s) { int fd = open(path, O_RDONLY); int fd = open(path, O_RDONLY | O_CLOEXEC); if (fd != -1) { char bytes[1024]; ssize_t byteCount; Loading core/jni/android_hardware_SerialPort.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -134,7 +134,7 @@ android_hardware_SerialPort_open(JNIEnv *env, jobject thiz, jobject fileDescript int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); // duplicate the file descriptor, since ParcelFileDescriptor will eventually close its copy fd = dup(fd); fd = fcntl(fd, F_DUPFD_CLOEXEC, 0); if (fd < 0) { jniThrowException(env, "java/io/IOException", "Could not open serial port"); return; Loading Loading
core/jni/android/graphics/BitmapFactory.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -551,7 +551,7 @@ static jobject nativeDecodeFileDescriptor(JNIEnv* env, jobject clazz, jobject fi // if we only close the file descriptor and not the file object it is used to // create. If we don't explicitly clean up the file (which in turn closes the // descriptor) the buffers allocated internally by fseek will be leaked. int dupDescriptor = dup(descriptor); int dupDescriptor = fcntl(descriptor, F_DUPFD_CLOEXEC, 0); FILE* file = fdopen(dupDescriptor, "r"); if (file == NULL) { Loading
core/jni/android/graphics/ImageDecoder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ static jobject ImageDecoder_nCreateFd(JNIEnv* env, jobject /*clazz*/, "broken file descriptor; fstat returned -1", nullptr, source); } int dupDescriptor = dup(descriptor); int dupDescriptor = fcntl(descriptor, F_DUPFD_CLOEXEC, 0); FILE* file = fdopen(dupDescriptor, "r"); if (file == NULL) { close(dupDescriptor); Loading
core/jni/android_content_res_ApkAssets.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ static jlong NativeLoadFromFd(JNIEnv* env, jclass /*clazz*/, jobject file_descri return 0; } unique_fd dup_fd(::dup(fd)); unique_fd dup_fd(::fcntl(fd, F_DUPFD_CLOEXEC, 0)); if (dup_fd < 0) { jniThrowIOException(env, errno); return 0; Loading
core/jni/android_ddm_DdmHandleNativeHeap.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ struct Header { namespace android { static void ReadFile(const char* path, String8& s) { int fd = open(path, O_RDONLY); int fd = open(path, O_RDONLY | O_CLOEXEC); if (fd != -1) { char bytes[1024]; ssize_t byteCount; Loading
core/jni/android_hardware_SerialPort.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -134,7 +134,7 @@ android_hardware_SerialPort_open(JNIEnv *env, jobject thiz, jobject fileDescript int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); // duplicate the file descriptor, since ParcelFileDescriptor will eventually close its copy fd = dup(fd); fd = fcntl(fd, F_DUPFD_CLOEXEC, 0); if (fd < 0) { jniThrowException(env, "java/io/IOException", "Could not open serial port"); return; Loading