From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: [babeltrace][PATCH] fs.c: initialize the other_entry variable Date: Wed, 11 Mar 2020 21:25:26 +0800 Message-ID: <1583933126-67509-1-git-send-email-mingli.yu@windriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by lists.lttng.org (Postfix) with ESMTPS id 48cw9g1fHSz1FkS for ; Wed, 11 Mar 2020 11:00:06 -0400 (EDT) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.2) with ESMTPS id 02BDPRUN020451 (version=TLSv1 cipher=AES256-SHA bits=256 verify=FAIL) for ; Wed, 11 Mar 2020 06:25:27 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" To: lttng-dev@lists.lttng.org List-Id: lttng-dev@lists.lttng.org From: Mingli Yu Initialize the pointer other_entry to fix the below error: | ../../../../../git/src/plugins/ctf/fs-src/fs.c: In function 'ds_index_insert_ds_index_entry_sorted': | ../../../../../git/src/plugins/ctf/fs-src/fs.c:702:5: error: 'other_entry' may be used uninitialized in this function [-Werror=maybe-uninitialized] | 702 | !ds_index_entries_equal(entry, other_entry)) { Signed-off-by: Mingli Yu --- src/plugins/ctf/fs-src/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/ctf/fs-src/fs.c b/src/plugins/ctf/fs-src/fs.c index e87523a..a6b5315 100644 --- a/src/plugins/ctf/fs-src/fs.c +++ b/src/plugins/ctf/fs-src/fs.c @@ -680,7 +680,7 @@ void ds_index_insert_ds_index_entry_sorted( struct ctf_fs_ds_index_entry *entry) { guint i; - struct ctf_fs_ds_index_entry *other_entry; + struct ctf_fs_ds_index_entry *other_entry = NULL; /* Find the spot where to insert this index entry. */ for (i = 0; i < index->entries->len; i++) { -- 2.7.4