Browse Source

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
commit
6bc5a84a0b
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      recording-daemon/db.c

+ 1
- 0
recording-daemon/db.c View File

@ -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