Re: [DTrace-devel] [PATCH 7/7] module ranges: fix file pointer leak

Eugene Loh <[email protected]>
Newsgroups dev.linux.lists.dtrace
Message-ID <[email protected]>
Reviewed-by: Eugene Loh <[email protected]>

On 11/18/25 11:38, Kris Van Hees via DTrace-devel wrote:
> The file pointer to modules.builtin.ranges was never closed.
>
> Signed-off-by: Kris Van Hees <[email protected]>
> ---
>   libdtrace/dt_module.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/libdtrace/dt_module.c b/libdtrace/dt_module.c
> index 7ec1b550..00978911 100644
> --- a/libdtrace/dt_module.c
> +++ b/libdtrace/dt_module.c
> @@ -1618,8 +1618,12 @@ dtrace_update(dtrace_hdl_t *dtp)
>   		dt_module_shuffle_to_start(dtp, "vmlinux");
>   	}
>   
> -	if (state)
> +	if (state) {
> +		if (state->rfp)
> +			fclose(state->rfp);
> +
>   		dt_free(dtp, state);
> +	}
>   
>   	return 0;
>   }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.