From 5401e9117ce50ecfba3d86b0d4d84ef8fbdc396f Mon Sep 17 00:00:00 2001 From: Monsta Date: Sun, 16 Nov 2014 17:13:24 +0300 Subject: avoid dereferencing NULL pointer Closes https://github.com/mate-desktop/mate-applets/pull/114 --- cpufreq/src/cpufreq-utils.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cpufreq/src') diff --git a/cpufreq/src/cpufreq-utils.c b/cpufreq/src/cpufreq-utils.c index 7afe0db6..3e3325ca 100644 --- a/cpufreq/src/cpufreq-utils.c +++ b/cpufreq/src/cpufreq-utils.c @@ -299,11 +299,12 @@ cpufreq_file_get_contents (const gchar *filename, g_free (display_filename); - if (buffer) + if (buffer) { *contents = g_string_free (buffer, FALSE); - - if (length) - *length = strlen (*contents); + + if (length) + *length = strlen (*contents); + } close (fd); -- cgit v1.2.1