fetch-pack: do not use lockfile structure on stack.
They are used in atexit() for clean-up, and you will be
accessing unallocated memory at that point.
See 31f584c2 for the fix for a similar problem.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
@ -625,6 +625,8 @@ static int remove_duplicates(int nr_heads, char **heads)
|
|||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct lock_file lock;
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, ret, nr_heads;
|
int i, ret, nr_heads;
|
||||||
@ -632,7 +634,6 @@ int main(int argc, char **argv)
|
|||||||
int fd[2];
|
int fd[2];
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
struct lock_file lock;
|
|
||||||
|
|
||||||
setup_git_directory();
|
setup_git_directory();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user