emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Leak in selinux stuff?


From: Eli Zaretskii
Subject: Re: Leak in selinux stuff?
Date: Sat, 19 Aug 2023 10:26:48 +0300

> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]