diff src/protocols/irc/irc.c @ 10903:c153119be7d0

[gaim-migrate @ 12630] Fix some minor leaks when something goes wrong connecting to IRC committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 07 May 2005 13:08:21 +0000
parents 94cc67130789
children ec90b7d126be
line wrap: on
line diff
--- a/src/protocols/irc/irc.c	Fri May 06 00:14:30 2005 +0000
+++ b/src/protocols/irc/irc.c	Sat May 07 13:08:21 2005 +0000
@@ -292,6 +292,7 @@
 		buf = irc_format(irc, "vv", "PASS", pass);
 		if (irc_send(irc, buf) < 0) {
 			gaim_connection_error(gc, "Error sending password");
+			g_free(buf);
 			return FALSE;
 		}
 		g_free(buf);
@@ -305,12 +306,14 @@
 			      strlen(realname) ? realname : IRC_DEFAULT_ALIAS);
 	if (irc_send(irc, buf) < 0) {
 		gaim_connection_error(gc, "Error registering with server");
+		g_free(buf);
 		return FALSE;
 	}
 	g_free(buf);
 	buf = irc_format(irc, "vn", "NICK", gaim_connection_get_display_name(gc));
 	if (irc_send(irc, buf) < 0) {
 		gaim_connection_error(gc, "Error sending nickname");
+		g_free(buf);
 		return FALSE;
 	}
 	g_free(buf);