Fix resource leak at main-linux.cpp:read_sources.

JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com
This commit is contained in:
Evgeny Gavrin 2015-07-07 20:40:36 +03:00
parent 69bfcea697
commit 6a4565c891

View File

@ -68,6 +68,7 @@ read_sources (const char *script_file_names[],
if (script_len < 0)
{
fclose (file);
break;
}
@ -77,12 +78,14 @@ read_sources (const char *script_file_names[],
if (source_buffer_tail + current_source_size >= source_buffer + sizeof (source_buffer))
{
fclose (file);
break;
}
size_t bytes_read = fread (source_buffer_tail, 1, current_source_size, file);
if (bytes_read < current_source_size)
{
fclose (file);
break;
}