TT#108003 Fix file descriptor leak in db_close_stream()

We need to close the file descriptor too in the early return.

Change-Id: I978c58bdc64c171f0ba7112d631aa2a4908c77ce
Warned-by: coverity
pull/1194/head
Guillem Jover 5 years ago
parent 6d51b3afc7
commit 6bc5a84a0b

@ -391,6 +391,7 @@ void db_close_stream(output_t *op) {
size_t count = fread(stream.s, 1, stream.len, f);
if (count != stream.len) {
ilog(LOG_ERR, "Failed to read from stream");
fclose(f);
if ((output_storage & OUTPUT_STORAGE_FILE))
goto file;
return;

Loading…
Cancel
Save