Skip to content

libuio: fix FILE descriptor leak#1053

Open
Qliangw wants to merge 2 commits into
openembedded:master-nextfrom
Qliangw:Qliangw-patch-1
Open

libuio: fix FILE descriptor leak#1053
Qliangw wants to merge 2 commits into
openembedded:master-nextfrom
Qliangw:Qliangw-patch-1

Conversation

@Qliangw

@Qliangw Qliangw commented May 27, 2026

Copy link
Copy Markdown

The function uio_line_from_file() fails to close the FILE pointer when fgets() returns NULL, causing a file descriptor leak.

This can be triggered when reading from /sys files that return empty content, leading to resource exhaustion over time.

Fix this by using goto-based error handling to ensure fclose() is called on all exit paths.

kraj and others added 2 commits May 24, 2026 09:11
This patch is not right and moreover not needed anymore
with latest clang

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
The function uio_line_from_file() fails to close the FILE pointer
when fgets() returns NULL, causing a file descriptor leak.

This can be triggered when reading from /sys files that return
empty content, leading to resource exhaustion over time.

Fix this by using goto-based error handling to ensure fclose()
is called on all exit paths.

Signed-off-by: Qliangw <qili00001@gmail.com>
@Qliangw Qliangw force-pushed the Qliangw-patch-1 branch from b0d9b3d to 7bbb904 Compare May 28, 2026 00:18
@halstead halstead force-pushed the master-next branch 18 times, most recently from bbb28db to ccba300 Compare June 12, 2026 14:30
@halstead halstead force-pushed the master-next branch 2 times, most recently from 439d5e5 to 041a530 Compare June 16, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants