[Xfce4-commits] [panel-plugins/xfce4-battery-plugin] 04/08: Fix possible memory leak

noreply at xfce.org noreply at xfce.org
Mon Dec 31 23:17:13 CET 2018


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

a   n   d   r   e       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-battery-plugin.

commit b32c015ed36c0f6e9e053351482303a15615847a
Author: Andre Miranda <andreldm at xfce.org>
Date:   Mon Dec 31 18:15:52 2018 -0300

    Fix possible memory leak
---
 panel-plugin/battery.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/battery.c b/panel-plugin/battery.c
index 630e157..7ee4cb1 100644
--- a/panel-plugin/battery.c
+++ b/panel-plugin/battery.c
@@ -294,9 +294,11 @@ update_apm_status(t_battmon *battmon)
           new_state = BM_FULL;
         }
         if (acline && new_state != BM_MISSING) {
+            gchar *tmp = g_strdup(icon_name);
+            g_free(icon_name);
             new_state++;
-            gchar * tmp = g_strdup(icon_name); g_free(icon_name);
             icon_name = g_strconcat(tmp, "-charging", NULL);
+            g_free(tmp);
         }
         DBG("old_state=%d, new_state=%d, icon_name=%s", old_state, new_state, icon_name);
         if (old_state != new_state)

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


More information about the Xfce4-commits mailing list