[Rpm-maint] [rpm-software-management/rpm] Close file on all paths to prevent resource leak (PR #3930)
Piotr Idzik
notifications at github.com
Thu Sep 11 11:35:00 UTC 2025
vil02 left a comment (rpm-software-management/rpm#3930)
> How did you stumble over this?
There was no magic: cppcheck was reporting `resourceLeak`. The exact output looked like:
```
$ cppcheck tests/rpmpgppubkeyfingerprint.c
Checking tests/rpmpgppubkeyfingerprint.c ...
tests/rpmpgppubkeyfingerprint.c:45:2: error: Resource leak: f [resourceLeak]
return 1;
^
tests/rpmpgppubkeyfingerprint.c:54:2: error: Resource leak: f [resourceLeak]
return 1;
^
tests/rpmpgppubkeyfingerprint.c:64:6: error: Resource leak: f [resourceLeak]
return 0;
^
tests/rpmpgppubkeyfingerprint.c:67:2: error: Resource leak: f [resourceLeak]
return 1;
^
tests/rpmpgppubkeyfingerprint.c:74:2: error: Resource leak: f [resourceLeak]
return 1;
^
tests/rpmpgppubkeyfingerprint.c:81:2: error: Resource leak: f [resourceLeak]
return 1;
^
tests/rpmpgppubkeyfingerprint.c:86:5: error: Resource leak: f [resourceLeak]
return 0;
^
```
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3930#issuecomment-3280108751
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3930/c3280108751 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250911/a18f83d7/attachment.htm>
More information about the Rpm-maint
mailing list