Index: irc_im.c
===================================================================
--- irc_im.c	(revision 3dcc878f69180d58b9a42768d7ef5ac9c542e4fa)
+++ irc_im.c	(revision 61d21e5b7a3d309038d5b3210ab261858e7334e3)
@@ -235,5 +235,5 @@
 			} else {
 				/* Modules can swallow messages. */
-				goto cleanup;
+				return TRUE;
 			}
 		}
@@ -250,7 +250,6 @@
 	wrapped = word_wrap(msg, 425);
 	irc_send_msg(iu, "PRIVMSG", dst, wrapped, prefix);
+
 	g_free(wrapped);
-
-cleanup:
 	g_free(prefix);
 	g_free(msg);
@@ -292,6 +291,4 @@
 
 	irc_send_msg((irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL);
-
-	g_string_free(msg, TRUE);
 
 	return TRUE;
@@ -698,6 +695,5 @@
 	irc_t *irc = bee->ui_data;
 	irc_channel_t *ic = c->ui_data, *oic;
-	char *stripped, *full_name;
-	gsize bytes_written;
+	char stripped[MAX_NICK_LENGTH + 1], *full_name;
 
 	if (ic == NULL) {
@@ -710,9 +706,6 @@
 	}
 
-	stripped = g_convert_with_fallback(name, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, &bytes_written, NULL);
-	if (bytes_written > MAX_NICK_LENGTH) {
-		stripped[MAX_NICK_LENGTH] = '\0';
-	}
-
+	strncpy(stripped, name, MAX_NICK_LENGTH);
+	stripped[MAX_NICK_LENGTH] = '\0';
 	irc_channel_name_strip(stripped);
 	if (set_getbool(&bee->set, "lcnicks")) {
@@ -721,10 +714,8 @@
 
 	if (stripped[0] == '\0') {
-		g_free(stripped);
 		return FALSE;
 	}
 
 	full_name = g_strdup_printf("#%s", stripped);
-	g_free(stripped);
 	if ((oic = irc_channel_by_name(irc, full_name))) {
 		char *type, *chat_type;
Index: lib/ssl_gnutls.c
===================================================================
--- lib/ssl_gnutls.c	(revision 3dcc878f69180d58b9a42768d7ef5ac9c542e4fa)
+++ lib/ssl_gnutls.c	(revision 61d21e5b7a3d309038d5b3210ab261858e7334e3)
@@ -124,5 +124,4 @@
 
 	if (conn->fd < 0) {
-		g_free(conn->hostname);
 		g_free(conn);
 		return NULL;
@@ -315,5 +314,4 @@
 	if (source == -1) {
 		conn->func(conn->data, 0, NULL, cond);
-		g_free(conn->hostname);
 		g_free(conn);
 		return FALSE;
@@ -357,5 +355,8 @@
 			conn->func(conn->data, 0, NULL, cond);
 
-			ssl_disconnect(conn);
+			gnutls_deinit(conn->session);
+			closesocket(conn->fd);
+
+			g_free(conn);
 		}
 	} else {
@@ -363,5 +364,8 @@
 			conn->func(conn->data, stver, NULL, cond);
 
-			ssl_disconnect(conn);
+			gnutls_deinit(conn->session);
+			closesocket(conn->fd);
+
+			g_free(conn);
 		} else {
 			/* For now we can't handle non-blocking perfectly everywhere... */
Index: otr.c
===================================================================
--- otr.c	(revision 3dcc878f69180d58b9a42768d7ef5ac9c542e4fa)
+++ otr.c	(revision 61d21e5b7a3d309038d5b3210ab261858e7334e3)
@@ -287,5 +287,4 @@
 void otr_irc_free(irc_t *irc)
 {
-	set_t *s;
 	otr_t *otr = irc->otr;
 
@@ -293,8 +292,4 @@
 	b_event_remove(otr->timer);
 	otrl_userstate_free(otr->us);
-
-	s = set_find(&irc->b->set, "otr_policy");
-	g_slist_free(s->eval_data);
-
 	if (otr->keygen) {
 		kill(otr->keygen, SIGTERM);
@@ -439,8 +434,4 @@
 	                                    ic->acc->user, ic->acc->prpl->name, iu->bu->handle, msg, &newmsg,
 	                                    &tlvs, NULL, NULL, NULL);
-
-	if (tlvs) {
-		otrl_tlv_free(tlvs);
-	}
 
 	if (ignore_msg) {
@@ -481,5 +472,5 @@
 		/* libotr wants us to replace our message */
 		/* NB: caller will free old msg */
-		msg = st ? NULL : g_strdup(otrmsg);
+		msg = g_strdup(otrmsg);
 		otrl_message_free(otrmsg);
 	}
@@ -1334,6 +1325,4 @@
 
 	log_message(LOGLVL_INFO, "otr: %s", msg);
-
-	g_free(msg);
 }
 
@@ -2086,2 +2075,4 @@
 	}
 }
+
+/* vim: set noet ts=4 sw=4: */
Index: protocols/jabber/jabber_util.c
===================================================================
--- protocols/jabber/jabber_util.c	(revision 3dcc878f69180d58b9a42768d7ef5ac9c542e4fa)
+++ protocols/jabber/jabber_util.c	(revision 61d21e5b7a3d309038d5b3210ab261858e7334e3)
@@ -566,5 +566,4 @@
 
 	if ((s = strchr(jid, '=')) == NULL) {
-		g_free(jid);
 		return NULL;
 	}
Index: protocols/msn/msn_util.c
===================================================================
--- protocols/msn/msn_util.c	(revision 3dcc878f69180d58b9a42768d7ef5ac9c542e4fa)
+++ protocols/msn/msn_util.c	(revision 61d21e5b7a3d309038d5b3210ab261858e7334e3)
@@ -174,7 +174,11 @@
 };
 
-static void msn_buddy_ask_free(void *data)
+static void msn_buddy_ask_yes(void *data)
 {
 	struct msn_buddy_ask_data *bla = data;
+
+	msn_buddy_list_add(bla->ic, MSN_BUDDY_AL, bla->handle, bla->realname, NULL);
+
+	imcb_ask_add(bla->ic, bla->handle, NULL);
 
 	g_free(bla->handle);
@@ -183,22 +187,13 @@
 }
 
-static void msn_buddy_ask_yes(void *data)
+static void msn_buddy_ask_no(void *data)
 {
 	struct msn_buddy_ask_data *bla = data;
 
-	msn_buddy_list_add(bla->ic, MSN_BUDDY_AL, bla->handle, bla->realname, NULL);
-
-	imcb_ask_add(bla->ic, bla->handle, NULL);
-
-	msn_buddy_ask_free(bla);
-}
-
-static void msn_buddy_ask_no(void *data)
-{
-	struct msn_buddy_ask_data *bla = data;
-
 	msn_buddy_list_add(bla->ic, MSN_BUDDY_BL, bla->handle, bla->realname, NULL);
 
-	msn_buddy_ask_free(bla);
+	g_free(bla->handle);
+	g_free(bla->realname);
+	g_free(bla);
 }
 
@@ -221,6 +216,5 @@
 	           "The user %s (%s) wants to add you to his/her buddy list.",
 	           bu->handle, bu->fullname);
-
-	imcb_ask_with_free(bu->ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no, msn_buddy_ask_free);
+	imcb_ask(bu->ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no);
 }
 
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision 3dcc878f69180d58b9a42768d7ef5ac9c542e4fa)
+++ protocols/nogaim.c	(revision 61d21e5b7a3d309038d5b3210ab261858e7334e3)
@@ -498,7 +498,9 @@
 };
 
-static void imcb_ask_cb_free(void *data)
+static void imcb_ask_auth_cb_no(void *data)
 {
 	struct imcb_ask_cb_data *cbd = data;
+
+	cbd->ic->acc->prpl->auth_deny(cbd->ic, cbd->handle);
 
 	g_free(cbd->handle);
@@ -506,20 +508,12 @@
 }
 
-static void imcb_ask_auth_cb_no(void *data)
+static void imcb_ask_auth_cb_yes(void *data)
 {
 	struct imcb_ask_cb_data *cbd = data;
 
-	cbd->ic->acc->prpl->auth_deny(cbd->ic, cbd->handle);
-
-	imcb_ask_cb_free(cbd);
-}
-
-static void imcb_ask_auth_cb_yes(void *data)
-{
-	struct imcb_ask_cb_data *cbd = data;
-
 	cbd->ic->acc->prpl->auth_allow(cbd->ic, cbd->handle);
 
-	imcb_ask_cb_free(cbd);
+	g_free(cbd->handle);
+	g_free(cbd);
 }
 
@@ -541,7 +535,12 @@
 	data->handle = g_strdup(handle);
 	query_add((irc_t *) ic->bee->ui_data, ic, s,
-	          imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, imcb_ask_cb_free, data);
-
-	g_free(s);
+	          imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, g_free, data);
+}
+
+
+static void imcb_ask_add_cb_no(void *data)
+{
+	g_free(((struct imcb_ask_cb_data*) data)->handle);
+	g_free(data);
 }
 
@@ -552,10 +551,10 @@
 	cbd->ic->acc->prpl->add_buddy(cbd->ic, cbd->handle, NULL);
 
-	imcb_ask_cb_free(data);
+	imcb_ask_add_cb_no(data);
 }
 
 void imcb_ask_add(struct im_connection *ic, const char *handle, const char *realname)
 {
-	struct imcb_ask_cb_data *data;
+	struct imcb_ask_cb_data *data = g_new0(struct imcb_ask_cb_data, 1);
 	char *s;
 
@@ -565,6 +564,4 @@
 	}
 
-	data = g_new0(struct imcb_ask_cb_data, 1);
-
 	s = g_strdup_printf("The user %s is not in your buddy list yet. Do you want to add him/her now?", handle);
 
@@ -572,7 +569,5 @@
 	data->handle = g_strdup(handle);
 	query_add((irc_t *) ic->bee->ui_data, ic, s,
-	          imcb_ask_add_cb_yes, imcb_ask_cb_free, imcb_ask_cb_free, data);
-
-	g_free(s);
+	          imcb_ask_add_cb_yes, imcb_ask_add_cb_no, g_free, data);
 }
 
Index: storage_xml.c
===================================================================
--- storage_xml.c	(revision 3dcc878f69180d58b9a42768d7ef5ac9c542e4fa)
+++ storage_xml.c	(revision 61d21e5b7a3d309038d5b3210ab261858e7334e3)
@@ -128,6 +128,4 @@
 		}
 	} else {
-		g_free(pass_cr);
-		g_free(password);
 		return XT_ABORT;
 	}
