summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs/libgadu/files/libgadu-1.9.0-memleak.patch')
-rw-r--r--net-libs/libgadu/files/libgadu-1.9.0-memleak.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/net-libs/libgadu/files/libgadu-1.9.0-memleak.patch b/net-libs/libgadu/files/libgadu-1.9.0-memleak.patch
new file mode 100644
index 000000000000..c0cdc7785f9d
--- /dev/null
+++ b/net-libs/libgadu/files/libgadu-1.9.0-memleak.patch
@@ -0,0 +1,42 @@
+Index: src/events.c
+===================================================================
+--- src/events.c (revision 976)
++++ src/events.c (revision 987)
+@@ -72,6 +72,7 @@
+ free(e->event.msg.message);
+ free(e->event.msg.formats);
+ free(e->event.msg.recipients);
++ free(e->event.msg.xhtml_message);
+ break;
+
+ case GG_EVENT_NOTIFY:
+@@ -420,6 +421,7 @@
+ {
+ struct gg_recv_msg *r = (struct gg_recv_msg*) ((char*) h + sizeof(struct gg_header));
+ char *p, *packet_end = (char*) r + h->length;
++ int ctcp = 0;
+
+ gg_debug_session(sess, GG_DEBUG_FUNCTION, "** gg_handle_recv_msg(%p, %p);\n", h, e);
+
+@@ -438,6 +440,7 @@
+
+ if (*p == 0x02 && p == packet_end - 1) {
+ gg_debug_session(sess, GG_DEBUG_MISC, "// gg_handle_recv_msg() received ctcp packet\n");
++ ctcp = 1;
+ break;
+ }
+
+@@ -463,8 +466,12 @@
+ e->event.msg.sender = gg_fix32(r->sender);
+ e->event.msg.time = gg_fix32(r->time);
+ e->event.msg.seq = gg_fix32(r->seq);
+- e->event.msg.message = (unsigned char*) strdup((char*) r + sizeof(*r));
++ if (ctcp)
++ e->event.msg.message = (unsigned char*) strdup("\x02");
++ else
++ e->event.msg.message = (unsigned char*) strdup((char*) r + sizeof(*r));
+
++
+ return 0;
+
+ malformed: