From 41698375ada57d51cf6db5cf25970ccd1b918180 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 12 Sep 2009 10:43:27 +0200 Subject: don't dereference NULL upon fdopen failure There were several unchecked use of fdopen(); replace them with xfdopen() that checks and dies. Signed-off-by: Jim Meyering Signed-off-by: Junio C Hamano --- builtin-mailsplit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-mailsplit.c') diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c index ee6ca0ebcd..dfe5b151e6 100644 --- a/builtin-mailsplit.c +++ b/builtin-mailsplit.c @@ -64,7 +64,7 @@ static int split_one(FILE *mbox, const char *name, int allow_bare) fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 0666); if (fd < 0) die_errno("cannot open output file '%s'", name); - output = fdopen(fd, "w"); + output = xfdopen(fd, "w"); /* Copy it out, while searching for a line that begins with * "From " and having something that looks like a date format. -- cgit v1.2.1