Data file reader: Avoid crash after failing to open file
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 14 Jul 2012 12:18:08 +0000 (14:18 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 14 Jul 2012 12:18:08 +0000 (14:18 +0200)
src/language/data-io/data-reader.c

index ea95bc983298d54acc24df5c55b62f1495436c07..14cb57d77a8597de6ac6d8cc7d420fd0d08e9f85 100644 (file)
@@ -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;
     }