From bb6ad28c23f05e1ea04e3f1c6b9b08cc070c5318 Mon Sep 17 00:00:00 2001 From: Sverre Rabbelier Date: Sun, 28 Mar 2010 00:42:48 -0500 Subject: [PATCH] fast-export: don't segfault when marks file cannot be opened The error function only prints an error message, resulting in a segfault if we later on try to fprintf to a NULL handle. Fix this by using die_errno instead. Signed-off-by: Sverre Rabbelier Signed-off-by: Junio C Hamano --- builtin-fast-export.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-fast-export.c b/builtin-fast-export.c index b0a4029c94..c6dd71a7bc 100644 --- a/builtin-fast-export.c +++ b/builtin-fast-export.c @@ -503,7 +503,7 @@ static void export_marks(char *file) f = fopen(file, "w"); if (!f) - error("Unable to open marks file %s for writing.", file); + die_errno("Unable to open marks file %s for writing.", file); for (i = 0; i < idnums.size; i++) { if (deco->base && deco->base->type == 1) { -- 2.11.4.GIT