@matheusbsbs / matheus-bagliano / commits / bb6ad28c23
Fork 0

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 <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sverre Rabbelier committed Mar 28, 2010 at 00:42 UTC bb6ad28c23f05e1ea04e3f1c6b9b08cc070c5318
1 file changed +1 -1
builtin-fast-export.c
+1 -1
@@ -503,7 +503,7 @@ static void export_marks(char *file)
503
504 f = fopen(file, "w");
505 if (!f)
506 - error("Unable to open marks file %s for writing.", file);
506 + die_errno("Unable to open marks file %s for writing.", file);
507
508 for (i = 0; i < idnums.size; i++) {
509 if (deco->base && deco->base->type == 1) {