[nautilus/wip/oholy/initialize-autofree] search-engine-tracker: Explicitly initialize g_autofree variable
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/oholy/initialize-autofree] search-engine-tracker: Explicitly initialize g_autofree variable
- Date: Mon, 21 Dec 2020 11:51:52 +0000 (UTC)
commit df2354c65b3f43978ad3a3d3afc05a221367d776
Author: Ondrej Holy <oholy redhat com>
Date: Mon Dec 21 12:45:56 2020 +0100
search-engine-tracker: Explicitly initialize g_autofree variable
The filtered_search_text variable is not explicitly initialized
although it is mandatory when g_autofree is used. Consequently, the
following warning is shown: "warning: ‘filtered_search_text’ may be
used uninitialized in this function". Let's explicitly initialize the
variable to get rid of that warning.
src/nautilus-search-engine-tracker.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/nautilus-search-engine-tracker.c b/src/nautilus-search-engine-tracker.c
index 9ebac0b28..a4ec78758 100644
--- a/src/nautilus-search-engine-tracker.c
+++ b/src/nautilus-search-engine-tracker.c
@@ -396,7 +396,7 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider)
if (tracker->fts_enabled && *search_text)
{
/* Use fts:match only for content search to not lose some filename results due to stop words. */
- g_autofree gchar *filtered_search_text;
+ g_autofree gchar *filtered_search_text = NULL;
filtered_search_text = filter_alnum_strdup (search_text);
g_string_append_printf (sparql,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]