[Xfce4-commits] <midori:master> Address leak in midori_web_settings_low_memory_profile

Christian Dywan noreply at xfce.org
Thu Dec 6 02:32:02 CET 2012


Updating branch refs/heads/master
         to 1f47b2de8710f0b7db540681f4025e744cb5a5cc (commit)
       from ab1d8a381fd1b0d48d0d262407fc6c788abf8c14 (commit)

commit 1f47b2de8710f0b7db540681f4025e744cb5a5cc
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Dec 5 21:16:22 2012 +0100

    Address leak in midori_web_settings_low_memory_profile

 midori/midori-websettings.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index f9bfda1..a56c8c4 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -247,14 +247,15 @@ midori_web_settings_low_memory_profile ()
 #else
     gchar* contents;
     const gchar* total;
-    if (!g_file_get_contents ("/proc/meminfo", &contents, NULL, NULL))
-        return FALSE;
-    if (contents && (total = strstr (contents, "MemTotal:")) && *total)
+    if (g_file_get_contents ("/proc/meminfo", &contents, NULL, NULL)
+     && contents && (total = strstr (contents, "MemTotal:")) && *total)
     {
         const gchar* value = katze_skip_whitespace (total + 9);
         gdouble mem_total = g_ascii_strtoll (value, NULL, 0);
+        g_free (contents);
         return mem_total / 1024.0 < 352 + 1;
     }
+    g_free (contents);
 #endif
     return FALSE;
 }


More information about the Xfce4-commits mailing list