read-cache: use of memory after it is freed

introduced with c46c406ae1 (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>
Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Carlo Marcelo Arenas Belón 2018-10-20 00:33:34 -07:00 committed by Junio C Hamano
parent 5f4436a721
commit b42ad7d57d

View File

@ -2038,8 +2038,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;
}