From 4b81e8ff10c3973388cd022e243237cd32262b23 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 14 Nov 2011 12:39:58 +0100 Subject: don't leak uri returned by g_file_get_uri() God I hate _get functions returning new memory... https://bugzilla.gnome.org/show_bug.cgi?id=663873 --- libempathy-gtk/empathy-log-window.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index c6f526daa..6fd1ff827 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -603,6 +603,7 @@ empathy_log_window_init (EmpathyLogWindow *self) GFile *gfile; GtkWidget *vbox, *accounts, *search, *label, *closeitem; GtkWidget *scrolledwindow_events; + gchar *uri; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EMPATHY_TYPE_LOG_WINDOW, EmpathyLogWindowPriv); @@ -745,9 +746,10 @@ empathy_log_window_init (EmpathyLogWindow *self) gfile = g_file_new_for_path (filename); g_free (filename); - webkit_web_view_load_uri (WEBKIT_WEB_VIEW (self->priv->webview), - g_file_get_uri (gfile)); + uri = g_file_get_uri (gfile); + webkit_web_view_load_uri (WEBKIT_WEB_VIEW (self->priv->webview), uri); g_object_unref (gfile); + g_free (uri); /* handle all navigation externally */ g_signal_connect (self->priv->webview, "navigation-policy-decision-requested", -- cgit v1.2.3