summaryrefslogtreecommitdiff
path: root/builtin-mailsplit.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-09-12 08:43:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-09-13 08:32:20 (GMT)
commit41698375ada57d51cf6db5cf25970ccd1b918180 (patch)
treea1ed2b0f32a829bdb0b4cece3d85df933b924962 /builtin-mailsplit.c
parent3d913526b19545eb4e463f96d2f3b8db8daae6ef (diff)
downloadgit-41698375ada57d51cf6db5cf25970ccd1b918180.zip
git-41698375ada57d51cf6db5cf25970ccd1b918180.tar.gz
git-41698375ada57d51cf6db5cf25970ccd1b918180.tar.bz2
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 <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-mailsplit.c')
-rw-r--r--builtin-mailsplit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c
index ee6ca0e..dfe5b15 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.