git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] read-cache: use of memory after it is freed
@ 2018-10-20  7:33 Carlo Marcelo Arenas Belón
  2018-10-20 15:15 ` Duy Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Carlo Marcelo Arenas Belón @ 2018-10-20  7:33 UTC (permalink / raw)
  To: git; +Cc: pclouds, Carlo Marcelo Arenas Belón

introduced with c46c406ae1e (trace.h: support nested performance tracing)
on Aug 18, 2018 but not affecting maint

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 read-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/read-cache.c b/read-cache.c
index 1df5c16dbc..78f47d2f50 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2297,8 +2297,8 @@ int read_index_from(struct index_state *istate, const char *path,
 	freshen_shared_index(base_path, 0);
 	merge_base_index(istate);
 	post_read_index_from(istate);
-	free(base_path);
 	trace_performance_leave("read cache %s", base_path);
+	free(base_path);
 	return ret;
 }
 
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] read-cache: use of memory after it is freed
  2018-10-20  7:33 [PATCH] read-cache: use of memory after it is freed Carlo Marcelo Arenas Belón
@ 2018-10-20 15:15 ` Duy Nguyen
  2018-10-22  3:39   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Duy Nguyen @ 2018-10-20 15:15 UTC (permalink / raw)
  To: carenas; +Cc: Git Mailing List

On Sat, Oct 20, 2018 at 9:33 AM Carlo Marcelo Arenas Belón
<carenas@gmail.com> wrote:
>
> introduced with c46c406ae1e (trace.h: support nested performance tracing)
> on Aug 18, 2018 but not affecting maint
>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  read-cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/read-cache.c b/read-cache.c
> index 1df5c16dbc..78f47d2f50 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -2297,8 +2297,8 @@ int read_index_from(struct index_state *istate, const char *path,
>         freshen_shared_index(base_path, 0);
>         merge_base_index(istate);
>         post_read_index_from(istate);
> -       free(base_path);
>         trace_performance_leave("read cache %s", base_path);
> +       free(base_path);

Oops. Ack.

>         return ret;
>  }
>
> --
> 2.19.1
>


-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] read-cache: use of memory after it is freed
  2018-10-20 15:15 ` Duy Nguyen
@ 2018-10-22  3:39   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2018-10-22  3:39 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: carenas, Git Mailing List

Duy Nguyen <pclouds@gmail.com> writes:

>>         freshen_shared_index(base_path, 0);
>>         merge_base_index(istate);
>>         post_read_index_from(istate);
>> -       free(base_path);
>>         trace_performance_leave("read cache %s", base_path);
>> +       free(base_path);
>
> Oops. Ack.

Thanks, both.

>> introduced with c46c406ae1e (trace.h: support nested performance tracing)
>> on Aug 18, 2018 but not affecting maint

Yup.  The series nd/unpack-trees-with-cache-tree however was
designed to be merge-able down to 'maint', so it is a good idea to
fix this at the tip of the topic.  So I'll queue it on top of
5f4436a7 ("Document update for nd/unpack-trees-with-cache-tree",
2018-08-25).

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-22  3:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-20  7:33 [PATCH] read-cache: use of memory after it is freed Carlo Marcelo Arenas Belón
2018-10-20 15:15 ` Duy Nguyen
2018-10-22  3:39   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.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).