From 523cdc315bbc9486fd8cb0c9cc557e0e0879dbe1 Mon Sep 17 00:00:00 2001 From: Ondrej Čerman Date: Fri, 31 Jan 2020 22:10:34 +0100 Subject: Fixed mem leak Version 1.3.1 --- src/gui.c | 2 +- src/ss/os.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui.c b/src/gui.c index 8378286..ce3a193 100644 --- a/src/gui.c +++ b/src/gui.c @@ -141,7 +141,7 @@ static void add_columns (GtkTreeView *treeview) { static void about_btn_clicked(GtkButton *button, gpointer user_data) { GtkWidget *dialog; const gchar *website = "https://github.com/ocerman/zenmonitor"; - const gchar *msg = "Zen Monitor 1.3\n" + const gchar *msg = "Zen Monitor 1.3.1\n" "Monitoring software for AMD Zen-based CPUs\n" "%s\n\n" "Created by: Ondrej Čerman"; diff --git a/src/ss/os.c b/src/ss/os.c index a491c02..a3ee7a6 100644 --- a/src/ss/os.c +++ b/src/ss/os.c @@ -17,10 +17,15 @@ gfloat *core_freq_max; static gdouble get_frequency(guint coreid) { gchar *data; + gdouble freq; + if (!g_file_get_contents(frq_files[coreid], &data, NULL, NULL)) return 0.0; - return atoi(data) / 1000000.0; + freq = atoi(data) / 1000000.0; + g_free(data); + + return freq; } gboolean os_init(void) { -- cgit v1.2.3-70-g09d2