grpc / grpc

The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
https://grpc.io
Apache License 2.0
41.92k stars 10.55k forks source link

The handle 'file_descriptor' is created by calling function 'open' and lost . #37694

Open suhovv opened 1 month ago

suhovv commented 1 month ago

File: https://github.com/grpc/grpc/blob/v1.66.1/src/core/lib/security/security_connector/load_system_roots_supported.cc Line: 125

he file descriptor file_descriptor created by calling open(roots_filenames[i].path, O_RDONLY) is not closed at the end of the method, causing a resource leak.

After calling open, to avoid leaks, you must close the descriptor using close(file_descriptor) after the file has been read.

veblush commented 1 month ago

It looks like a legitimate bug. Thanks for your report.