diff options
Diffstat (limited to 'progs/slang/vstest.c')
-rw-r--r-- | progs/slang/vstest.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/progs/slang/vstest.c b/progs/slang/vstest.c index 472ea9b62e..33c6f09dc5 100644 --- a/progs/slang/vstest.c +++ b/progs/slang/vstest.c @@ -220,6 +220,12 @@ static void load_test_file (const char *filename) fseek (f, 0, SEEK_END); size = ftell (f); + + if (size == -1) { + fclose (f); + return; + } + fseek (f, 0, SEEK_SET); code = (char *) (malloc (size)); |