Skip to content

Commit bb6ad28

Browse files
SRabbeliergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0476228 commit bb6ad28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-fast-export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static void export_marks(char *file)
503503

504504
f = fopen(file, "w");
505505
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);
507507

508508
for (i = 0; i < idnums.size; i++) {
509509
if (deco->base && deco->base->type == 1) {

0 commit comments

Comments
 (0)