mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
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:
parent
69bfcea697
commit
6a4565c891
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user