[Xfce4-commits] [panel-plugins/xfce4-statusnotifier-plugin] 01/01: Fix some memory caused by g_variant_get calls

noreply at xfce.org noreply at xfce.org
Sun Aug 27 05:01:23 CEST 2017


This is an automated email from the git hooks/post-receive script.

n   i   n   e   t   l   s       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-statusnotifier-plugin.

commit 6acc16069e186cbf13677b2a670df7cd15b0bb5a
Author: Viktor Odintsev <ninetls at xfce.org>
Date:   Sun Aug 27 06:00:12 2017 +0300

    Fix some memory caused by g_variant_get calls
---
 panel-plugin/sn-backend.c |  2 ++
 panel-plugin/sn-item.c    | 16 +++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/sn-backend.c b/panel-plugin/sn-backend.c
index 9da6684..e0baac9 100644
--- a/panel-plugin/sn-backend.c
+++ b/panel-plugin/sn-backend.c
@@ -335,6 +335,8 @@ sn_backend_watcher_name_owner_changed (GDBusConnection *connection,
       sn_watcher_emit_status_notifier_item_unregistered (backend->watcher_skeleton, key);
       g_free (key);
     }
+
+  g_free (new_owner);
 }
 
 
diff --git a/panel-plugin/sn-item.c b/panel-plugin/sn-item.c
index d9bbf0a..fb04955 100644
--- a/panel-plugin/sn-item.c
+++ b/panel-plugin/sn-item.c
@@ -403,11 +403,15 @@ sn_item_name_owner_changed (GDBusConnection *connection,
                             GVariant        *parameters,
                             gpointer         user_data)
 {
-  SnItem *item = user_data;
-  gchar  *new_owner;
+  SnItem   *item = user_data;
+  gchar    *new_owner;
+  gboolean  finish;
 
   g_variant_get (parameters, "(sss)", NULL, NULL, &new_owner);
-  return_and_finish_if_true (new_owner == NULL || strlen (new_owner) == 0);
+  finish = new_owner == NULL || strlen (new_owner) == 0;
+  g_free (new_owner);
+
+  return_and_finish_if_true (finish);
 }
 
 
@@ -561,6 +565,8 @@ sn_item_signal_received (GDBusProxy *proxy,
     {
       g_variant_get (parameters, "(s)", &status);
       exposed = sn_item_status_is_exposed (status);
+      g_free (status);
+
       if (exposed != item->exposed)
         {
           item->exposed = exposed;
@@ -645,6 +651,8 @@ sn_item_extract_pixbuf (GVariant *variant)
         }
     }
 
+  g_variant_iter_free (iter);
+
   if (array != NULL)
     {
       /* argb to rgba */
@@ -745,6 +753,8 @@ sn_item_get_all_properties_result (GObject      *source_object,
         g_variant_get (value, "(sa(iiay)ss)", NULL, NULL, &str_val1, &str_val2);
         update_new_string (str_val1, tooltip_title, update_tooltip);
         update_new_string (str_val2, tooltip_subtitle, update_tooltip);
+        g_free (str_val1);
+        g_free (str_val2);
       }
     else if (!g_strcmp0 (name, "ItemIsMenu"))
       {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list