summary refs log tree commit diff stats
path: root/src/common/text.c
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2014-12-08 21:25:00 -0800
committerArnavion <arnavion@gmail.com>2014-12-08 21:25:00 -0800
commit2da5308fd299c13f42b5b42b125b7bd80f8268f2 (patch)
tree0e26bcd59d78c867c03411c79f7493089603ddd2 /src/common/text.c
parentc1831cb19dc1a95bfe96c808aaf5ee42f7401995 (diff)
Fixed leak of filename string.
Diffstat (limited to 'src/common/text.c')
-rw-r--r--src/common/text.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/text.c b/src/common/text.c
index 5af98073..90e400e2 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -623,14 +623,15 @@ log_open (session *sess)
 
 	if (!log_error && sess->logfd == -1)
 	{
-		char *message;
+		char *filename = log_create_pathname (sess->server->servername, sess->channel, server_get_network (sess->server, FALSE));
+		char *message = g_strdup_printf (_("* Can't open log file(s) for writing. Check the\npermissions on %s"), filename);
 
-		message = g_strdup_printf (_("* Can't open log file(s) for writing. Check the\npermissions on %s"),
-			log_create_pathname (sess->server->servername, sess->channel, server_get_network (sess->server, FALSE)));
+		g_free (filename);
 
 		fe_message (message, FE_MSG_WAIT | FE_MSG_ERROR);
 
 		g_free (message);
+
 		log_error = TRUE;
 	}
 }