Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | From 42dae692b9057d03ce9a0651f061472e9dd90130 Mon Sep 17 00:00:00 2001 |
| 2 | From: Mingli Yu <mingli.yu@windriver.com> |
| 3 | Date: Wed, 11 Mar 2020 08:44:42 +0000 |
| 4 | Subject: [PATCH] fs.c: initialize the other_entry variable |
| 5 | |
| 6 | Initialize the pointer other_entry to fix the below error: |
| 7 | | ../../../../../git/src/plugins/ctf/fs-src/fs.c: In function 'ds_index_insert_ds_index_entry_sorted': |
| 8 | | ../../../../../git/src/plugins/ctf/fs-src/fs.c:702:5: error: 'other_entry' may be used uninitialized in this function [-Werror=maybe-uninitialized] |
| 9 | | 702 | !ds_index_entries_equal(entry, other_entry)) { |
| 10 | |
| 11 | Upstream-Status: Submitted [https://lists.lttng.org/pipermail/lttng-dev/2020-March/029549.html] |
| 12 | |
| 13 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> |
| 14 | --- |
| 15 | src/plugins/ctf/fs-src/fs.c | 2 +- |
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/src/plugins/ctf/fs-src/fs.c b/src/plugins/ctf/fs-src/fs.c |
| 19 | index e87523a3..a6b5315f 100644 |
| 20 | --- a/src/plugins/ctf/fs-src/fs.c |
| 21 | +++ b/src/plugins/ctf/fs-src/fs.c |
| 22 | @@ -680,7 +680,7 @@ void ds_index_insert_ds_index_entry_sorted( |
| 23 | struct ctf_fs_ds_index_entry *entry) |
| 24 | { |
| 25 | guint i; |
| 26 | - struct ctf_fs_ds_index_entry *other_entry; |
| 27 | + struct ctf_fs_ds_index_entry *other_entry = NULL; |
| 28 | |
| 29 | /* Find the spot where to insert this index entry. */ |
| 30 | for (i = 0; i < index->entries->len; i++) { |
| 31 | -- |
| 32 | 2.24.1 |
| 33 | |