* [BUG] Resource leaks in Xen
@ 2021-12-22 8:05 Ryan Cai
2021-12-22 9:28 ` Jan Beulich
0 siblings, 1 reply; 3+ messages in thread
From: Ryan Cai @ 2021-12-22 8:05 UTC (permalink / raw)
To: xen-devel, keir, dgdegra
[-- Attachment #1: Type: text/plain, Size: 477 bytes --]
Dear maintainers for Xen Project,
I am writing you to report potential resource leak bugs. In the file /xen/tools/flask/utils/label-pci.c, the methods fopen and fclose may not matched when returning at Line 76, resulting in a resource leak. Looking forward to your feedback. Thank for checking.
Locations, https://github.com/xen-project/xen/blame/25849c8b16f2a5b7fcd0a823e80a5f1b590291f9/tools/flask/utils/label-pci.c#L63-L76
Best,
Ryan Cai
[-- Attachment #2: Type: text/html, Size: 5856 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG] Resource leaks in Xen
2021-12-22 8:05 [BUG] Resource leaks in Xen Ryan Cai
@ 2021-12-22 9:28 ` Jan Beulich
2021-12-22 11:14 ` Ryan Cai
0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2021-12-22 9:28 UTC (permalink / raw)
To: Ryan Cai; +Cc: dgdegra, xen-devel@lists.xenproject.org
On 22.12.2021 09:05, Ryan Cai wrote:
> I am writing you to report potential resource leak bugs. In the file /xen/tools/flask/utils/label-pci.c, the methods fopen and fclose may not matched when returning at Line 76, resulting in a resource leak. Looking forward to your feedback. Thank for checking.
>
> Locations, https://github.com/xen-project/xen/blame/25849c8b16f2a5b7fcd0a823e80a5f1b590291f9/tools/flask/utils/label-pci.c#L63-L76
Thanks for looking closely, but I'm afraid I don't see where any
resources get leaked here: "f" will get closed implicitly after
returning from main(). It might be good practice to close files
explicitly, but that's purely cosmetic here afaics. Feel free to
contribute a patch.
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG] Resource leaks in Xen
2021-12-22 9:28 ` Jan Beulich
@ 2021-12-22 11:14 ` Ryan Cai
0 siblings, 0 replies; 3+ messages in thread
From: Ryan Cai @ 2021-12-22 11:14 UTC (permalink / raw)
To: Jan Beulich; +Cc: dgdegra, xen-devel@lists.xenproject.org
I have send a patch. Thank you for your reply.
Best,
Yuandao
On 22/12/2021, 5:28 PM, "Jan Beulich" <jbeulich@suse.com> wrote:
On 22.12.2021 09:05, Ryan Cai wrote:
> I am writing you to report potential resource leak bugs. In the file /xen/tools/flask/utils/label-pci.c, the methods fopen and fclose may not matched when returning at Line 76, resulting in a resource leak. Looking forward to your feedback. Thank for checking.
>
> Locations, https://github.com/xen-project/xen/blame/25849c8b16f2a5b7fcd0a823e80a5f1b590291f9/tools/flask/utils/label-pci.c#L63-L76
Thanks for looking closely, but I'm afraid I don't see where any
resources get leaked here: "f" will get closed implicitly after
returning from main(). It might be good practice to close files
explicitly, but that's purely cosmetic here afaics. Feel free to
contribute a patch.
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-22 11:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-22 8:05 [BUG] Resource leaks in Xen Ryan Cai
2021-12-22 9:28 ` Jan Beulich
2021-12-22 11:14 ` Ryan Cai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.