From patchwork Tue Oct 16 15:52:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10759565 Return-Path: Received: from mail-dm3nam03on0058.outbound.protection.outlook.com ([104.47.41.58]:32513 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726986AbeJPXoN (ORCPT ); Tue, 16 Oct 2018 19:44:13 -0400 From: Yordan Karadzhov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH v2 01/23] kernel-shark-qt: Fix a simple bug in KsDataStore::_freeData() Date: Tue, 16 Oct 2018 15:52:57 +0000 Message-ID: <20181016155232.5257-2-ykaradzhov@vmware.com> References: <20181016155232.5257-1-ykaradzhov@vmware.com> In-Reply-To: <20181016155232.5257-1-ykaradzhov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: After freeing the memory used to store the tracing data, this function has to set the _dataSize field to zero. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/KsUtils.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel-shark-qt/src/KsUtils.cpp b/kernel-shark-qt/src/KsUtils.cpp index 13b648e..5e4c9c8 100644 --- a/kernel-shark-qt/src/KsUtils.cpp +++ b/kernel-shark-qt/src/KsUtils.cpp @@ -144,6 +144,8 @@ void KsDataStore::_freeData() free(_rows); _rows = nullptr; } + + _dataSize = 0; } /** Reload the trace data. */