From 0d493bb831a7e8d0673f0a070a821aec3c7af74d Mon Sep 17 00:00:00 2001 From: Maciej Mrozowski Date: Sat, 5 Jun 2010 02:30:04 +0000 Subject: Add patch from mailing list to fix memory leak on receiving messages. (Portage version: 2.2_rc67/cvs/Linux x86_64) --- net-libs/libgadu/ChangeLog | 8 +++- net-libs/libgadu/files/libgadu-1.9.0-memleak.patch | 42 +++++++++++++++++ net-libs/libgadu/libgadu-1.9.0-r1.ebuild | 55 ++++++++++++++++++++++ net-libs/libgadu/libgadu-1.9.0.ebuild | 54 --------------------- 4 files changed, 104 insertions(+), 55 deletions(-) create mode 100644 net-libs/libgadu/files/libgadu-1.9.0-memleak.patch create mode 100644 net-libs/libgadu/libgadu-1.9.0-r1.ebuild delete mode 100644 net-libs/libgadu/libgadu-1.9.0.ebuild (limited to 'net-libs/libgadu') diff --git a/net-libs/libgadu/ChangeLog b/net-libs/libgadu/ChangeLog index 95f8d1b73736..44c81aaaa3aa 100644 --- a/net-libs/libgadu/ChangeLog +++ b/net-libs/libgadu/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-libs/libgadu # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libgadu/ChangeLog,v 1.38 2010/05/26 00:03:40 reavertm Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libgadu/ChangeLog,v 1.39 2010/06/05 02:30:03 reavertm Exp $ + +*libgadu-1.9.0-r1 (05 Jun 2010) + + 05 Jun 2010; Maciej Mrozowski -libgadu-1.9.0.ebuild, + +libgadu-1.9.0-r1.ebuild, +files/libgadu-1.9.0-memleak.patch: + Add patch from mailing list to fix memory leak on receiving messages. 25 May 2010; Maciej Mrozowski libgadu-1.9.0.ebuild: Make it POSIX compliant, remove some redundant code 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: diff --git a/net-libs/libgadu/libgadu-1.9.0-r1.ebuild b/net-libs/libgadu/libgadu-1.9.0-r1.ebuild new file mode 100644 index 000000000000..938caf769179 --- /dev/null +++ b/net-libs/libgadu/libgadu-1.9.0-r1.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-libs/libgadu/libgadu-1.9.0-r1.ebuild,v 1.1 2010/06/05 02:30:03 reavertm Exp $ + +EAPI="2" + +MY_P="${P/_/-}" + +inherit base + +DESCRIPTION="This library implements the client side of the Gadu-Gadu protocol" +HOMEPAGE="http://toxygen.net/libgadu/" +SRC_URI="http://toxygen.net/libgadu/files/${MY_P}.tar.gz" + +LICENSE="LGPL-2.1" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos" +SLOT="0" +IUSE="doc ssl static-libs threads" + +COMMON_DEPEND=" + ssl? ( >=dev-libs/openssl-0.9.6m ) +" +DEPEND="${COMMON_DEPEND} + doc? ( app-doc/doxygen ) +" +RDEPEND="${COMMON_DEPEND} + !=net-im/kadu-0.6.0.2 + !=net-im/kadu-0.6.0.1 +" + +S="${WORKDIR}/${MY_P}" + +PATCHES=( + "${FILESDIR}/${P}-memleak.patch" +) + +DOCS=(AUTHORS ChangeLog NEWS README) + +src_configure() { + econf \ + --enable-shared \ + $(use_enable static-libs static) \ + $(use_with threads pthread) \ + $(use_with ssl openssl) +} + +src_install() { + use doc && HTML_DOCS=(docs/html/) + base_src_install + + if ! use static-libs; then + find "${D}" -type f -name '*.la' -exec rm -f {} + \ + || die "la removal failed" + fi +} diff --git a/net-libs/libgadu/libgadu-1.9.0.ebuild b/net-libs/libgadu/libgadu-1.9.0.ebuild deleted file mode 100644 index 341bfd083c11..000000000000 --- a/net-libs/libgadu/libgadu-1.9.0.ebuild +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libgadu/libgadu-1.9.0.ebuild,v 1.2 2010/05/26 00:03:40 reavertm Exp $ - -EAPI="2" - -MY_P="${P/_/-}" - -inherit base - -DESCRIPTION="This library implements the client side of the Gadu-Gadu protocol" -HOMEPAGE="http://toxygen.net/libgadu/" -SRC_URI="http://toxygen.net/libgadu/files/${MY_P}.tar.gz" - -LICENSE="LGPL-2.1" -KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos" -SLOT="0" -IUSE="doc ssl static-libs threads" - -COMMON_DEPEND=" - ssl? ( >=dev-libs/openssl-0.9.6m ) -" -DEPEND="${COMMON_DEPEND} - doc? ( app-doc/doxygen ) -" -RDEPEND="${COMMON_DEPEND} - !=net-im/kadu-0.6.0.2 - !=net-im/kadu-0.6.0.1 -" - -S="${WORKDIR}/${MY_P}" - -DOCS=(AUTHORS ChangeLog NEWS README) - -src_configure() { - econf \ - --enable-shared \ - $(use_enable static-libs static) \ - $(use_with threads pthread) \ - $(use_with ssl openssl) -} - -src_install() { - base_src_install - - if ! use static-libs; then - find "${D}" -type f -name '*.la' -exec rm -f {} + \ - || die "la removal failed" - fi - - if use doc; then - dohtml -r docs/html/* || die "dohtml failed" - fi -} -- cgit v1.2.3-65-gdbad