Commits

Junio C Hamano  committed d64a09f Merge

Merge branch 'maint'

* maint:
fetch: do not leak a refspec

  • Participants
  • Parent commits 8fba5f9, d8ead15

Comments (0)

Files changed (1)

File builtin/fetch.c

 {
 	int i;
 	static const char **refs = NULL;
+	struct refspec *refspec;
 	int ref_nr = 0;
 	int exit_code;
 
 
 	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;