[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 01/01: remove superfluous g_free calls and thereby avoid memory corruption problems

noreply at xfce.org noreply at xfce.org
Wed Apr 5 23:58:09 CEST 2017


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

timystery pushed a commit to branch master
in repository panel-plugins/xfce4-sensors-plugin.

commit 98587a98dc4eb1ac0ae366f727fd12e6ce952e3b
Author: Fabian <timystery at arcor.de>
Date:   Wed Apr 5 23:57:40 2017 +0200

    remove superfluous g_free calls and thereby avoid memory corruption problems
---
 lib/configuration.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/lib/configuration.c b/lib/configuration.c
index 35150f0..0ea763b 100644
--- a/lib/configuration.c
+++ b/lib/configuration.c
@@ -284,7 +284,6 @@ sensors_read_general_config (XfceRc *ptr_xfceresources, t_sensors *ptr_sensors)
 void
 sensors_read_preliminary_config (XfcePanelPlugin *ptr_panelplugin, t_sensors *ptr_sensors)
 {
-    gchar *str_file;
     XfceRc *ptr_xfceresource;
 
     TRACE ("enters sensors_read_preliminary_config");
@@ -293,10 +292,9 @@ sensors_read_preliminary_config (XfcePanelPlugin *ptr_panelplugin, t_sensors *pt
     {
         g_return_if_fail(ptr_sensors!=NULL);
 
-        if ((str_file = ptr_sensors->plugin_config_file))
+        if ((ptr_sensors->plugin_config_file))
         {
-            ptr_xfceresource = xfce_rc_simple_open (str_file, TRUE);
-            g_free (str_file);
+            ptr_xfceresource = xfce_rc_simple_open (ptr_sensors->plugin_config_file, TRUE);
 
             if (ptr_xfceresource && xfce_rc_has_group (ptr_xfceresource, "General") ) {
                 xfce_rc_set_group (ptr_xfceresource, "General");
@@ -317,7 +315,6 @@ void
 sensors_read_config (XfcePanelPlugin *ptr_panelplugin, t_sensors *ptr_sensors)
 {
     const gchar *str_value;
-    gchar *str_file;
     XfceRc *ptr_xfceresource;
     gint idx_chip, idx_feature, idx_chiptmp;
     gchar str_rcchip[8], str_feature[20];
@@ -332,11 +329,10 @@ sensors_read_config (XfcePanelPlugin *ptr_panelplugin, t_sensors *ptr_sensors)
 
     g_return_if_fail(ptr_sensors!=NULL);
 
-    if (!(str_file = ptr_sensors->plugin_config_file))
+    if (!(ptr_sensors->plugin_config_file))
         return;
 
-    ptr_xfceresource = xfce_rc_simple_open (str_file, TRUE);
-    g_free (str_file);
+    ptr_xfceresource = xfce_rc_simple_open (ptr_sensors->plugin_config_file, TRUE);
 
     if (!ptr_xfceresource)
         return;

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


More information about the Xfce4-commits mailing list