summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c28cce5)
raw | patch | inline | side by side (parent: c28cce5)
author | Michael Haggerty <mhagger@alum.mit.edu> | |
Thu, 15 Sep 2011 21:10:38 +0000 (23:10 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Oct 2011 20:45:31 +0000 (13:45 -0700) |
read_ref() can (and in test t5800, actually *does*) return NULL.
Don't pass the NULL along to read_ref(). Coincidentally, this mistake
didn't make resolve_ref() blow up, but upcoming changes to
resolve_ref() will make it less forgiving.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Don't pass the NULL along to read_ref(). Coincidentally, this mistake
didn't make resolve_ref() blow up, but upcoming changes to
resolve_ref() will make it less forgiving.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport-helper.c | patch | blob | history |
diff --git a/transport-helper.c b/transport-helper.c
index 07131261fefeab2066636a7f83bce05796329a54..6f227e253bf638de37ce74347213657c23185afa 100644 (file)
--- a/transport-helper.c
+++ b/transport-helper.c
private = apply_refspecs(data->refspecs, data->refspec_nr, posn->name);
else
private = xstrdup(posn->name);
- read_ref(private, posn->old_sha1);
- free(private);
+ if (private) {
+ read_ref(private, posn->old_sha1);
+ free(private);
+ }
}
strbuf_release(&buf);
return 0;