summaryrefslogtreecommitdiff
path: root/multiload/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-02-07 14:04:48 +0100
committerLuke from DC <[email protected]>2022-03-23 04:16:43 +0000
commit1da4230926a9aa136d4b6a77f975aebce160f1a3 (patch)
tree17717b0a36ff485aa2e6f1e606cb32e35e2afaeb /multiload/src
parentb3892cf644c693fef44b5daf55a0b66a667ac147 (diff)
downloadmate-applets-1da4230926a9aa136d4b6a77f975aebce160f1a3.tar.bz2
mate-applets-1da4230926a9aa136d4b6a77f975aebce160f1a3.tar.xz
multiload: fix memory leak
Diffstat (limited to 'multiload/src')
-rw-r--r--multiload/src/properties.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/multiload/src/properties.c b/multiload/src/properties.c
index 7f237370..e776b7b8 100644
--- a/multiload/src/properties.c
+++ b/multiload/src/properties.c
@@ -523,12 +523,13 @@ read_color_button (GtkWidget *widget,
GdkRGBA color;
gchar *color_string;
- if ((color_string = g_settings_get_string (settings, key)) != NULL) {
+ color_string = g_settings_get_string (settings, key);
+ if (*color_string != '\0') {
gdk_rgba_parse (&color, color_string);
- g_free (color_string);
} else {
gdk_rgba_parse (&color, "#000000");
}
+ g_free (color_string);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (widget), &color);
if (!g_settings_is_writable (settings, key))