[epiphany] ephy-request-about: fix a potential crasher if the css file is missing



commit 819cc7dea0676deb2dc6b422683780ab2a1ed8c0
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed Nov 30 20:04:36 2011 +0100

    ephy-request-about: fix a potential crasher if the css file is missing
    
    And prevent the corresponding GError from leaking.

 embed/ephy-request-about.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/embed/ephy-request-about.c b/embed/ephy-request-about.c
index 3314427..0256c8d 100644
--- a/embed/ephy-request-about.c
+++ b/embed/ephy-request-about.c
@@ -72,9 +72,12 @@ static void
 read_css_style (EphyRequestAbout *about)
 {
   GError *error = NULL;
+  const gchar *file = ephy_file ("about.css");
 
-  if (!g_file_get_contents (ephy_file ("about.css"), &about->priv->css_style, NULL, &error))
+  if (file && !g_file_get_contents (file, &about->priv->css_style, NULL, &error)) {
     g_debug ("%s", error->message);
+    g_error_free (error);
+  }
 }
 
 static GInputStream *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]