[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH v2 03/20] commit-graph: use free() instead of UNLEAK()
From:       René_Scharfe <l.s.r () web ! de>
Date:       2022-12-30 16:26:52
Message-ID: 64923db2-fa0c-5ca3-6a43-ba215b85509e () web ! de
[Download RAW message or body]

Am 30.12.22 um 03:18 schrieb Ævar Arnfjörð Bjarmason:
> In 0bfb48e6723 (builtin/commit-graph.c: UNLEAK variables, 2018-10-03)
> this was made to UNLEAK(), but we can just as easily invoke the
> free_commit_graph() function added in c3756d5b7fc (commit-graph: add
> free_commit_graph, 2018-07-11) instead.

Patch and commit message are about free_commit_graph(), but the subject
still mentions free().

>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  builtin/commit-graph.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
> index e8f77f535f3..0102ac8540e 100644
> --- a/builtin/commit-graph.c
> +++ b/builtin/commit-graph.c
> @@ -67,6 +67,7 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
>  	int fd;
>  	struct stat st;
>  	int flags = 0;
> +	int ret;
>
>  	static struct option builtin_commit_graph_verify_options[] = {
>  		OPT_BOOL(0, "shallow", &opts.shallow,
> @@ -111,8 +112,9 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
>  	if (!graph)
>  		return !!open_ok;
>
> -	UNLEAK(graph);
> -	return verify_commit_graph(the_repository, graph, flags);
> +	ret = verify_commit_graph(the_repository, graph, flags);
> +	free_commit_graph(graph);
> +	return ret;
>  }
>
>  extern int read_replace_refs;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic