Skip to contentSkip to conversation

fs.c: initialize the other_entry variable

PATCH New [email protected] 1 participant 1 message Mar 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs.c: initialize the other_entry variable

From: Mingli Yu <[email protected]>

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)) {
---
 src/plugins/ctf/fs-src/fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/plugins/ctf/fs-src/fs.c +1 -1
index e87523a..a6b5315 100644
@@ -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++) {
Signature · 1 line
2.7.4