Skip to content

Commit

Permalink
fetch: do not leak a refspec
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Meyering <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
meyering authored and gitster committed Jun 9, 2011
1 parent e5af0de commit d8ead15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions builtin/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
{
int i;
static const char **refs = NULL;
struct refspec *refspec;
int ref_nr = 0;
int exit_code;

Expand Down Expand Up @@ -915,8 +916,9 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)

sigchain_push_common(unlock_pack_on_signal);
atexit(unlock_pack);
exit_code = do_fetch(transport,
parse_fetch_refspec(ref_nr, refs), ref_nr);
refspec = parse_fetch_refspec(ref_nr, refs);
exit_code = do_fetch(transport, refspec, ref_nr);
free(refspec);
transport_disconnect(transport);
transport = NULL;
return exit_code;
Expand Down

0 comments on commit d8ead15

Please sign in to comment.