From: Jérémie Galarneau Date: Thu, 3 Aug 2017 13:49:22 +0000 (-0400) Subject: Fix: unchecked return value of stream flush X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=885a8803311f24d33ae0bdd4b0b2adf8cc057a24;p=deliverable%2Fbabeltrace.git Fix: unchecked return value of stream flush Coverity: CID 1376154 (#1 of 1): Unchecked return value (CHECKED_RETURN)1. check_return: Calling bt_ctf_stream_flush without checking return value (as is done elsewhere 5 out of 6 times). Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/plugins/ctf/fs-sink/write.c b/plugins/ctf/fs-sink/write.c index 21938e6ff..995d344b8 100644 --- a/plugins/ctf/fs-sink/write.c +++ b/plugins/ctf/fs-sink/write.c @@ -66,10 +66,13 @@ gboolean empty_ht(gpointer key, gpointer value, gpointer user_data) static gboolean empty_streams_ht(gpointer key, gpointer value, gpointer user_data) { + int ret; struct bt_ctf_stream *writer_stream = value; - bt_ctf_stream_flush(writer_stream); - + ret = bt_ctf_stream_flush(writer_stream); + if (ret) { + BT_LOGD_STR("Failed to flush stream while emptying hash table."); + } return TRUE; }