Skip to content

Commit

Permalink
fetch-pack: do not use lockfile structure on stack.
Browse files Browse the repository at this point in the history
They are used in atexit() for clean-up, and you will be
accessing unallocated memory at that point.

See 31f584c for the fix for a similar problem.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jan 2, 2007
1 parent 96a738c commit 54b9e02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,14 +625,15 @@ 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;
char *dest = NULL, **heads;
int fd[2];
pid_t pid;
struct stat st;
struct lock_file lock;

setup_git_directory();

Expand Down

0 comments on commit 54b9e02

Please sign in to comment.