[PATCH 2/3] cpukit/libmisc/rtems-fdt: Fixes leaked variable 'bf' in rtems-fdt.c
Joel Sherrill
joel at rtems.org
Tue Jun 29 20:09:28 UTC 2021
I'm ok with the fix but the commit message could be improved.
Something like this would be better.
cpukit/libmisc/rtems-fdt.c : close() file to avoid leaking descriptor
You almost duplicated the base file name and it isn't leaking the
variable, it is leaking the file descriptor referenced by bf.
--joel
On Tue, Jun 29, 2021 at 2:54 PM Harrison Edward Gerber
<gerberhe11 at gmail.com> wrote:
>
> See Also CID 1437645
>
> Closes #4297
> ---
> cpukit/libmisc/rtems-fdt/rtems-fdt.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/cpukit/libmisc/rtems-fdt/rtems-fdt.c b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
> index bfbc6102a2..5580d415e2 100644
> --- a/cpukit/libmisc/rtems-fdt/rtems-fdt.c
> +++ b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
> @@ -611,6 +611,7 @@ rtems_fdt_load (const char* filename, rtems_fdt_handle* handle)
> return fe;
> }
>
> + close (bf);
> return 0;
> }
>
> --
> 2.25.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
More information about the devel
mailing list