From 235ac40772e259adfd978850b56192dca9791bb8 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 24 Apr 2005 14:31:57 -0700 Subject: Don't add references to objects we couldn't find. That would SIGSEGV. --- tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tree.c') diff --git a/tree.c b/tree.c index 3537c11558..26b7927080 100644 --- a/tree.c +++ b/tree.c @@ -137,7 +137,8 @@ int parse_tree(struct tree *item) entry->item.blob = lookup_blob(file_sha1); obj = &entry->item.blob->object; } - add_ref(&item->object, obj); + if (obj) + add_ref(&item->object, obj); *list_p = entry; list_p = &entry->next; -- cgit v1.2.1