* Leak in selinux stuff?
[not found] <87y1i7em8t.fsf.ref@yahoo.com>
@ 2023-08-19 3:37 ` Po Lu
2023-08-19 7:26 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Po Lu @ 2023-08-19 3:37 UTC (permalink / raw)
To: emacs-devel
fileio.c is littered with code like such:
/* See https://debbugs.gnu.org/11245 for ENOTSUP. */
if (fail && errno != ENOTSUP)
report_file_error ("Doing lsetfilecon", absname);
context_free (parsed_con);
freecon (con);
where `parsed_con' and `con' are allocated by libselinux functions by
the likes of `lgetfilecon'. Around such code, no measures are
apparently taken for deallocating those objects should a non local exit
occur. Am I missing anything, or should this be fixed?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Leak in selinux stuff?
2023-08-19 3:37 ` Leak in selinux stuff? Po Lu
@ 2023-08-19 7:26 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-08-19 7:26 UTC (permalink / raw)
To: Po Lu, Paul Eggert; +Cc: emacs-devel
> From: Po Lu <luangruo@yahoo.com>
> Date: Sat, 19 Aug 2023 11:37:06 +0800
>
> fileio.c is littered with code like such:
>
> /* See https://debbugs.gnu.org/11245 for ENOTSUP. */
> if (fail && errno != ENOTSUP)
> report_file_error ("Doing lsetfilecon", absname);
>
> context_free (parsed_con);
> freecon (con);
>
> where `parsed_con' and `con' are allocated by libselinux functions by
> the likes of `lgetfilecon'. Around such code, no measures are
> apparently taken for deallocating those objects should a non local exit
> occur. Am I missing anything, or should this be fixed?
IMO, they should either free the resources before signaling an error,
or use record_unwind_protect to free the allocated resources, yes.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-19 7:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <87y1i7em8t.fsf.ref@yahoo.com>
2023-08-19 3:37 ` Leak in selinux stuff? Po Lu
2023-08-19 7:26 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).