From: John Darrington Date: Sat, 14 Jul 2012 12:18:08 +0000 (+0200) Subject: Data file reader: Avoid crash after failing to open file X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00fa82224d75f1c89f568df761acb9ff096f2898;p=pspp Data file reader: Avoid crash after failing to open file --- diff --git a/src/language/data-io/data-reader.c b/src/language/data-io/data-reader.c index ea95bc9832..14cb57d77a 100644 --- a/src/language/data-io/data-reader.c +++ b/src/language/data-io/data-reader.c @@ -162,6 +162,7 @@ dfm_open_reader (struct file_handle *fh, struct lexer *lexer, { msg (ME, _("Could not open `%s' for reading as a data file: %s."), fh_get_file_name (r->fh), strerror (errno)); + goto error; } r->file_size = fstat (fileno (r->file), &s) == 0 ? s.st_size : -1; }