Thread (1 message) 1 message, 1 author, 2019-02-07

Re: [PATCH v2] fetch-pack: clear alternate shallow when complete

From: Junio C Hamano <hidden>
Date: 2019-02-07 02:48:01

Duy Nguyen [off-list ref] writes:
On Thu, Feb 7, 2019 at 7:00 AM brian m. carlson
[off-list ref] wrote:
quoted
When we write an alternate shallow file in update_shallow, we write it
into the lock file. The string stored in alternate_shallow_file is
copied from the lock file path, but it is freed the moment that the lock
file is closed, since we call strbuf_release to free that path.

This used to work, since we did not invoke git index-pack more than
once. However, we now do, and starting with bd0b42aed3 (fetch-pack: do
not take shallow lock unnecessarily - 2019-01-10), we no longer reset
this value unconditionally; consequently, we reuse the freed memory.
Ensure we reset the value to NULL to avoid using freed memory. git
index-pack will read the repository's shallow file, which will have been
updated with the correct information.
The patch looks good to me.
Thanks, all.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help