diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-11 20:44:10 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-11 20:44:10 +0300 |
commit | 1401236842d871e3a40d5c40e7914b6ef8908899 (patch) | |
tree | 893520078f86414f410b4c05f9280e650f7142ff /builtin/fetch.c | |
parent | 5f30bb4a8144a2132568021a18972a89c1dfd3ca (diff) | |
parent | b7410f616ea938ab34816b04e0479d55877af511 (diff) |
Merge branch 'km/fetch-do-not-free-remote-name' into maint
The ownership rule for the piece of memory that hold references to
be fetched in "git fetch" was screwy, which has been cleaned up.
* km/fetch-do-not-free-remote-name:
builtin/fetch.c: don't free remote->name after fetch
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r-- | builtin/fetch.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index 1582ca7184..f896aa1f88 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1005,7 +1005,7 @@ static int get_remote_group(const char *key, const char *value, void *priv) size_t wordlen = strcspn(value, " \t\n"); if (wordlen >= 1) - string_list_append(g->list, + string_list_append_nodup(g->list, xstrndup(value, wordlen)); value += wordlen + (value[wordlen] != '\0'); } @@ -1143,7 +1143,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv) int cmd_fetch(int argc, const char **argv, const char *prefix) { int i; - struct string_list list = STRING_LIST_INIT_NODUP; + struct string_list list = STRING_LIST_INIT_DUP; struct remote *remote; int result = 0; struct argv_array argv_gc_auto = ARGV_ARRAY_INIT; @@ -1226,8 +1226,6 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) argv_array_clear(&options); } - /* All names were strdup()ed or strndup()ed */ - list.strdup_strings = 1; string_list_clear(&list, 0); close_all_packs(); |