[gnome-builder/gnome-builder-3-28] xml-pack: dont leak matching state
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-28] xml-pack: dont leak matching state
- Date: Tue, 19 Jun 2018 00:20:18 +0000 (UTC)
commit 52e2d2025d279ff2a69b9b68d730dce470eb8284
Author: Christian Hergert <chergert redhat com>
Date: Mon Jun 18 17:19:32 2018 -0700
xml-pack: dont leak matching state
src/plugins/xml-pack/ide-xml-completion-values.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/xml-pack/ide-xml-completion-values.c
b/src/plugins/xml-pack/ide-xml-completion-values.c
index c10ee4440..e2f156bc0 100644
--- a/src/plugins/xml-pack/ide-xml-completion-values.c
+++ b/src/plugins/xml-pack/ide-xml-completion-values.c
@@ -23,8 +23,8 @@ typedef struct _MatchingState
{
IdeXmlRngDefine *define;
GPtrArray *match_values;
- const gchar *values;
- const gchar *prefix;
+ gchar *values;
+ gchar *prefix;
guint is_initial_state : 1;
} MatchingState;
@@ -95,8 +95,8 @@ matching_state_new (IdeXmlRngDefine *define,
state = g_slice_new0 (MatchingState);
state->define = define;
- state->values = (values != NULL) ? g_strdup (values) : NULL;
- state->prefix = (prefix != NULL) ? g_strdup (prefix) : NULL;
+ state->values = g_strdup (values);
+ state->prefix = g_strdup (prefix);
state->is_initial_state = FALSE;
@@ -108,6 +108,7 @@ matching_state_free (MatchingState *state)
{
g_clear_pointer (&state->values, g_free);
g_clear_pointer (&state->prefix, g_free);
+ g_slice_free (MatchingState, state);
}
static GPtrArray *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]