From 4f5e83e681ea800446ff700a0fe4d60397e56913 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 12 Feb 2021 10:14:29 -0500 Subject: [PATCH] TT#14008 fix possible mem leak Change-Id: Ie506c74e8effc9dcb88331377cdb5cff2ed0d9a4 --- recording-daemon/db.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recording-daemon/db.c b/recording-daemon/db.c index 7eb856501..341fd9a00 100644 --- a/recording-daemon/db.c +++ b/recording-daemon/db.c @@ -398,10 +398,12 @@ void db_close_stream(output_t *op) { if (stream.s) { size_t count = fread(stream.s, 1, stream.len, f); if (count != stream.len) { + stream.len = 0; ilog(LOG_ERR, "Failed to read from stream"); fclose(f); if ((output_storage & OUTPUT_STORAGE_FILE)) goto file; + free(stream.s); return; } }