summaryrefslogtreecommitdiff
path: root/sensors-applet
diff options
context:
space:
mode:
Diffstat (limited to 'sensors-applet')
-rw-r--r--sensors-applet/active-sensor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sensors-applet/active-sensor.c b/sensors-applet/active-sensor.c
index 27619ac..7cf9df5 100644
--- a/sensors-applet/active-sensor.c
+++ b/sensors-applet/active-sensor.c
@@ -378,14 +378,14 @@ static void active_sensor_set_graph_dimensions(ActiveSensor *as,
old_num_samples = as->num_samples;
as->num_samples = num_samples;
- as->sensor_values = g_malloc0(sizeof(gdouble)*as->num_samples);
+ as->sensor_values = g_new0 (gdouble, as->num_samples);
memcpy(as->sensor_values,
old_values,
MIN(old_num_samples, as->num_samples)*sizeof(gdouble));
g_free(old_values);
} else {
- as->sensor_values = g_malloc0(sizeof(gdouble)*num_samples);
+ as->sensor_values = g_new0 (gdouble, num_samples);
as->num_samples = num_samples;
}