summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2019-09-03 19:08:04 +0200
committerAlberto Fanjul <albertofanjul@gmail.com>2019-09-03 18:13:02 +0000
commit2d276eaed5bd15e577240c0a31a3b5f10899bfc9 (patch)
tree6259f62f26cb9589fa1e00a06b32d9cbb2f4b949
parent216506aded7ccbf1c3cb8e68ab08ee581832bd05 (diff)
downloadglade-2d276eaed5bd15e577240c0a31a3b5f10899bfc9.tar.gz
gladeui: fix several tiny memory leaks found with valgrind
-rw-r--r--gladeui/glade-project.c11
-rw-r--r--gladeui/glade-widget.c6
-rw-r--r--plugins/gtk+/glade-gtk-label.c2
3 files changed, 17 insertions, 2 deletions
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index 36d1b81f..6c7495c5 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -2139,7 +2139,10 @@ glade_project_load_internal (GladeProject *project)
g_signal_emit (project, glade_project_signals[PARSE_BEGAN], 0);
if ((domain = glade_xml_get_property_string (root, GLADE_TAG_DOMAIN)))
- glade_project_set_translation_domain (project, domain);
+ {
+ glade_project_set_translation_domain (project, domain);
+ g_free (domain);
+ }
glade_project_read_comments (project, root);
@@ -2664,6 +2667,7 @@ glade_project_write_comments (GladeProject *project,
/* Replace regular HYPHEN with NON-BREAKING HYPHEN */
gchar *license = _glade_util_strreplace (priv->license, FALSE, "--", "‑‑");
gchar *comment = g_strdup_printf (GLADE_PROJECT_COMMENT"\n\n%s\n\n", license);
+ g_free (license);
comment_node = glade_xml_doc_new_comment (doc, comment);
g_free (comment);
}
@@ -2768,7 +2772,10 @@ glade_project_backup (GladeProject *project, const gchar *path, GError **error)
success = g_file_get_contents (project->priv->path, &content, &length, error);
if (success)
- success = g_file_set_contents (destination_path, content, length, error);
+ {
+ success = g_file_set_contents (destination_path, content, length, error);
+ g_free (content);
+ }
g_free (destination_path);
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 1efea6cc..9e7718b9 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -4983,6 +4983,12 @@ glade_widget_verify (GladeWidget *widget)
if (string)
warning = g_string_free (string, FALSE);
+
+ if (warn_signals)
+ g_list_free (warn_signals);
+
+ if (warn_properties)
+ g_list_free (warn_properties);
}
glade_widget_set_support_warning (widget, warning);
diff --git a/plugins/gtk+/glade-gtk-label.c b/plugins/gtk+/glade-gtk-label.c
index 68dc3100..3f5bb38f 100644
--- a/plugins/gtk+/glade-gtk-label.c
+++ b/plugins/gtk+/glade-gtk-label.c
@@ -463,6 +463,8 @@ glade_gtk_label_write_attributes (GladeWidget *widget,
glade_xml_node_set_property_string (attr_node, GLADE_TAG_NAME, attr_type);
glade_xml_node_set_property_string (attr_node, GLADE_TAG_VALUE,
attr_value);
+ g_free (attr_type);
+ g_free (attr_value);
}
}