Skip to content

Commit

Permalink
fast-export: don't segfault when marks file cannot be opened
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sverre Rabbelier authored and Junio C Hamano committed Mar 28, 2010
1 parent 0476228 commit bb6ad28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-fast-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit bb6ad28

Please sign in to comment.