[epiphany/gnome-3-2] ephy-request-about: fix a potential crasher if the css file is missing
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-2] ephy-request-about: fix a potential crasher if the css file is missing
- Date: Wed, 30 Nov 2011 19:08:08 +0000 (UTC)
commit 8f3c0789fe233f6c213bdee419179e18c40f84f4
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]