@matheusbsbs / matheus-bagliano / commits / 54b9e0225a
Fork 0

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>

Junio C Hamano committed Jan 2, 2007 at 11:22 UTC 54b9e0225ad150b4528d7a12f2196ad46f058302
1 file changed +2 -1
fetch-pack.c
+2 -1
@@ -625,6 +625,8 @@ static int remove_duplicates(int nr_heads, char **heads)
625 return dst;
626 }
627
628 +static struct lock_file lock;
629 +
630 int main(int argc, char **argv)
631 {
632 int i, ret, nr_heads;
@@ -632,7 +634,6 @@ int main(int argc, char **argv)
634 int fd[2];
635 pid_t pid;
636 struct stat st;
635 - struct lock_file lock;
637
638 setup_git_directory();
639