aboutsummaryrefslogtreecommitdiff
path: root/builtin-apply.c
diff options
context:
space:
mode:
authorDmitry Potapov <dpotapov@gmail.com>2008-10-05 06:14:40 +0400
committerShawn O. Pearce <spearce@spearce.org>2008-10-06 00:49:57 -0700
commitd09e2cd5516473753cb067e723293fab180e0b1b (patch)
treeebf5708b1076468cefe37763f41660cd1ce5256e /builtin-apply.c
parent62525ef78e8aec776f44da525030d76b52f14a57 (diff)
downloadgit-d09e2cd5516473753cb067e723293fab180e0b1b.tar.gz
git-d09e2cd5516473753cb067e723293fab180e0b1b.tar.xz
do not segfault if make_cache_entry failed
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'builtin-apply.c')
-rw-r--r--builtin-apply.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-apply.c b/builtin-apply.c
index 70c9f9355..2c87cf57f 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -2586,6 +2586,8 @@ static void build_fake_ancestor(struct patch *list, const char *filename)
sha1_ptr = sha1;
ce = make_cache_entry(patch->old_mode, sha1_ptr, name, 0, 0);
+ if (!ce)
+ die("make_cache_entry failed for path '%s'", name);
if (add_index_entry(&result, ce, ADD_CACHE_OK_TO_ADD))
die ("Could not add %s to temporary index", name);
}