summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-06-04 21:39:50 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-06-04 21:39:50 +0900
commit01cbd9eab5710a409e2e760fa20aeb701fa5e799 (patch)
tree937e4883ea81f673fc3fe58e47841533126e6b78
parentMerge branch 'tg/doc-sec-list' (diff)
parentrefspec-api: avoid uninitialized field in refspec item (diff)
downloadtgif-01cbd9eab5710a409e2e760fa20aeb701fa5e799.tar.xz
Merge branch 'bw/refspec-api'
Hotfix. * bw/refspec-api: refspec-api: avoid uninitialized field in refspec item
-rw-r--r--refspec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/refspec.c b/refspec.c
index ada7854f7a..78edc48ae8 100644
--- a/refspec.c
+++ b/refspec.c
@@ -49,6 +49,8 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet
size_t rlen = strlen(++rhs);
is_glob = (1 <= rlen && strchr(rhs, '*'));
item->dst = xstrndup(rhs, rlen);
+ } else {
+ item->dst = NULL;
}
llen = (rhs ? (rhs - lhs - 1) : strlen(lhs));