diff src/protocols/oscar/txqueue.c @ 13262:b08f8f3c9197

[gaim-migrate @ 15628] More cleanup. It's dinner time! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 12 Feb 2006 23:59:30 +0000
parents 7ead7b8aea63
children
line wrap: on
line diff
--- a/src/protocols/oscar/txqueue.c	Sun Feb 12 23:53:55 2006 +0000
+++ b/src/protocols/oscar/txqueue.c	Sun Feb 12 23:59:30 2006 +0000
@@ -81,12 +81,7 @@
 
 	if (datalen > 0) {
 		guint8 *data;
-
-		if (!(data = (unsigned char *)malloc(datalen))) {
-			aim_frame_destroy(fr);
-			return NULL;
-		}
-
+		data = malloc(datalen);
 		aim_bstream_init(&fr->data, data, datalen);
 	}
 
@@ -171,8 +166,7 @@
 
 	payloadlen = aim_bstream_curpos(&fr->data);
 
-	if (!(bs_raw = malloc(6 + payloadlen)))
-		return -ENOMEM;
+	bs_raw = malloc(6 + payloadlen);
 
 	aim_bstream_init(&bs, bs_raw, 6 + payloadlen);
 
@@ -208,8 +202,7 @@
 
 	payloadlen = aim_bstream_curpos(&fr->data);
 
-	if (!(bs_raw = malloc(8 + payloadlen)))
-		return -ENOMEM;
+	bs_raw = malloc(8 + payloadlen);
 
 	aim_bstream_init(&bs, bs_raw, 8 + payloadlen);
 
@@ -246,6 +239,27 @@
 	return -1;
 }
 
+/*
+ * This is responsible for removing sent commands from the transmit
+ * queue. This is not a required operation, but it of course helps
+ * reduce memory footprint at run time!
+ */
+static void
+aim_tx_purgequeue(OscarSession *sess)
+{
+	FlapFrame *cur, **prev;
+
+	for (prev = &sess->queue_outgoing; (cur = *prev); ) {
+		if (cur->handled) {
+			*prev = cur->next;
+			aim_frame_destroy(cur);
+		} else
+			prev = &cur->next;
+	}
+
+	return;
+}
+
 int
 aim_tx_flushqueue(OscarSession *sess)
 {
@@ -269,27 +283,6 @@
 	return 0;
 }
 
-/*
- * This is responsible for removing sent commands from the transmit
- * queue. This is not a required operation, but it of course helps
- * reduce memory footprint at run time!
- */
-void
-aim_tx_purgequeue(OscarSession *sess)
-{
-	FlapFrame *cur, **prev;
-
-	for (prev = &sess->queue_outgoing; (cur = *prev); ) {
-		if (cur->handled) {
-			*prev = cur->next;
-			aim_frame_destroy(cur);
-		} else
-			prev = &cur->next;
-	}
-
-	return;
-}
-
 /**
  * Get rid of packets waiting for tx on a dying conn.  For now this
  * simply marks all packets as sent and lets them disappear without