Browse Source

Fix a small memory leak in builtin-add

prune_directory and fill_directory allocated one byte per pathspec and never
freed it.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Benoit Sigoure 17 years ago committed by Junio C Hamano
parent
commit
399f0a8eed
  1. 2
      builtin-add.c

2
builtin-add.c

@ -44,6 +44,7 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p @@ -44,6 +44,7 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p
die("pathspec '%s' did not match any files",
pathspec[i]);
}
free(seen);
}

static void fill_directory(struct dir_struct *dir, const char **pathspec,
@ -140,6 +141,7 @@ static void refresh(int verbose, const char **pathspec) @@ -140,6 +141,7 @@ static void refresh(int verbose, const char **pathspec)
if (!seen[i])
die("pathspec '%s' did not match any files", pathspec[i]);
}
free(seen);
}

static int git_add_config(const char *var, const char *value)

Loading…
Cancel
Save