aboutsummaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-02 11:22:08 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-02 11:22:08 -0800
commit54b9e0225ad150b4528d7a12f2196ad46f058302 (patch)
tree4c196a43c849e960c1f124a66a8c64f62e0d43b6 /fetch-pack.c
parent96a738c0ddd49afc3bfcbf7575be55e492b69a82 (diff)
downloadgit-54b9e0225ad150b4528d7a12f2196ad46f058302.tar.gz
git-54b9e0225ad150b4528d7a12f2196ad46f058302.tar.xz
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>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index c527bf9e9..1530a9479 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -625,6 +625,8 @@ static int remove_duplicates(int nr_heads, char **heads)
return dst;
}
+static struct lock_file lock;
+
int main(int argc, char **argv)
{
int i, ret, nr_heads;
@@ -632,7 +634,6 @@ int main(int argc, char **argv)
int fd[2];
pid_t pid;
struct stat st;
- struct lock_file lock;
setup_git_directory();