[evolution] Fix a slight memory leak.



commit 9ac3461e48c7d747f36b73d08ace5f2bccda052a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jul 12 10:24:01 2012 -0400

    Fix a slight memory leak.

 mail/mail-send-recv.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 95e17ac..36101e1 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -365,6 +365,7 @@ format_url (CamelService *service)
 {
 	CamelProvider *provider;
 	CamelSettings *settings;
+	gchar *service_name = NULL;
 	const gchar *display_name;
 	const gchar *host = NULL;
 	const gchar *path = NULL;
@@ -386,8 +387,10 @@ format_url (CamelService *service)
 
 	/* This should never happen, but if the service has no
 	 * display name, fall back to the generic service name. */
-	if (display_name == NULL || *display_name == '\0')
-		display_name = camel_service_get_name (service, TRUE);
+	if (display_name == NULL || *display_name == '\0') {
+		service_name = camel_service_get_name (service, TRUE);
+		display_name = service_name;
+	}
 
 	if (host != NULL && *host != '\0')
 		pretty_url = g_markup_printf_escaped (
@@ -399,6 +402,8 @@ format_url (CamelService *service)
 		pretty_url = g_markup_printf_escaped (
 			"<b>%s</b>", display_name);
 
+	g_free (service_name);
+
 	return pretty_url;
 }
 



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