mirror of
https://github.com/git/git.git
synced 2025-04-14 19:45:33 +00:00
Fix refs.c;:repack_without_ref() clean-up path
The function repack_without_ref() passes a lock-file structure on the stack to hold_lock_file_for_update(), which in turn registers it to be cleaned up via atexit(). This is a big no-no. This is the same bug James Bottomley fixed with commit 31f584c242e7af28018ff920b6c8d1952beadbd4. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
14c8a681f7
commit
26a063a10b
3
refs.c
3
refs.c
@ -621,12 +621,13 @@ struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *o
|
||||
return lock_ref_sha1_basic(ref, old_sha1, NULL);
|
||||
}
|
||||
|
||||
static struct lock_file packlock;
|
||||
|
||||
static int repack_without_ref(const char *refname)
|
||||
{
|
||||
struct ref_list *list, *packed_ref_list;
|
||||
int fd;
|
||||
int found = 0;
|
||||
struct lock_file packlock;
|
||||
|
||||
packed_ref_list = get_packed_refs();
|
||||
for (list = packed_ref_list; list; list = list->next) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user