[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 01/01: Remove one more memory access issue and replace free() by g_free()

noreply at xfce.org noreply at xfce.org
Thu Apr 6 22:40:29 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 72886a8f2fff333a10ec850ecb11fb54dac0a975
Author: Fabian <timystery at arcor.de>
Date:   Thu Apr 6 22:35:13 2017 +0200

    Remove one more memory access issue and replace free() by g_free()
---
 lib/configuration.c     | 9 +++------
 lib/sensors-interface.c | 2 +-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/lib/configuration.c b/lib/configuration.c
index 0ea763b..ec9ecc0 100644
--- a/lib/configuration.c
+++ b/lib/configuration.c
@@ -399,25 +399,22 @@ sensors_read_config (XfcePanelPlugin *ptr_panelplugin, t_sensors *ptr_sensors)
                         else if ((str_value = xfce_rc_read_entry (ptr_xfceresource, "DeviceName", NULL))
                             && *str_value) {
                             if (ptr_chipfeature->devicename)
-                                free (ptr_chipfeature->devicename);
+                                g_free (ptr_chipfeature->devicename);
                             ptr_chipfeature->devicename = g_strdup(str_value);
-                            /* g_free (str_value); */
                         }
 
                         if ((str_value = xfce_rc_read_entry (ptr_xfceresource, "Name", NULL))
                                 && *str_value) {
                             if (ptr_chipfeature->name)
-                                free (ptr_chipfeature->name);
+                                g_free (ptr_chipfeature->name);
                             ptr_chipfeature->name = g_strdup (str_value);
-                            /* g_free (str_value); */
                         }
 
                         if ((str_value = xfce_rc_read_entry (ptr_xfceresource, "Color", NULL))
                                 && *str_value) {
                             if (ptr_chipfeature->color)
-                                free (ptr_chipfeature->color);
+                                g_free (ptr_chipfeature->color);
                             ptr_chipfeature->color = g_strdup (str_value);
-                            /* g_free (str_value); */
                         }
 
                         ptr_chipfeature->show =
diff --git a/lib/sensors-interface.c b/lib/sensors-interface.c
index 8ee559f..8c8b297 100644
--- a/lib/sensors-interface.c
+++ b/lib/sensors-interface.c
@@ -544,7 +544,7 @@ init_widgets (t_sensors_dialog *sd)
         chipfeature = (t_chipfeature *) g_ptr_array_index (ptr_chip_structure->chip_features, 0);
         g_assert (chipfeature!=NULL);
 
-        g_free(chipfeature->formatted_value);
+        //g_free(chipfeature->formatted_value);
         chipfeature->formatted_value = g_strdup ("0.0");
         chipfeature->raw_value = 0.0;
 

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


More information about the Xfce4-commits mailing list