summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2022-10-25 17:08:39 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2022-10-25 17:14:08 +0200
commit25ad4b051f2f4292e8362daea8f8b401be9b5795 (patch)
tree0eb8c5fab53b5ee87b63369036b5af63e90bc65c /net-libs/libaccounts-glib
parentmail-client/thunderbird: security cleanup, drop 91.13.1, 102.3.* (diff)
downloadgentoo-25ad4b051f2f4292e8362daea8f8b401be9b5795.tar.gz
gentoo-25ad4b051f2f4292e8362daea8f8b401be9b5795.tar.bz2
gentoo-25ad4b051f2f4292e8362daea8f8b401be9b5795.zip
net-libs/libaccounts-glib: Fix memleak
See also: https://gitlab.com/accounts-sso/libaccounts-glib/-/issues/13 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'net-libs/libaccounts-glib')
-rw-r--r--net-libs/libaccounts-glib/files/libaccounts-glib-1.26-fix-incorrect-cleanup-in-ag_account_finalize.patch30
-rw-r--r--net-libs/libaccounts-glib/libaccounts-glib-1.26-r1.ebuild64
2 files changed, 94 insertions, 0 deletions
diff --git a/net-libs/libaccounts-glib/files/libaccounts-glib-1.26-fix-incorrect-cleanup-in-ag_account_finalize.patch b/net-libs/libaccounts-glib/files/libaccounts-glib-1.26-fix-incorrect-cleanup-in-ag_account_finalize.patch
new file mode 100644
index 000000000000..0a6f1120882a
--- /dev/null
+++ b/net-libs/libaccounts-glib/files/libaccounts-glib-1.26-fix-incorrect-cleanup-in-ag_account_finalize.patch
@@ -0,0 +1,30 @@
+From 270a66d5efe1453a2be4bad10894b947fdd2923e Mon Sep 17 00:00:00 2001
+From: Alberto Mardegan <mardy@users.sourceforge.net>
+Date: Tue, 4 Oct 2022 20:58:27 +0300
+Subject: [PATCH] ag-account: fix incorrect cleanup in ag_account_finalize
+
+The wrong variable was passed to _ag_account_changes_free(); as a matter
+of facts, this code was always a NOP, since prig->services had already
+been nullified before, but it was a memory leak.
+
+Fixes: https://gitlab.com/accounts-sso/libaccounts-glib/-/issues/13
+---
+ libaccounts-glib/ag-account.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libaccounts-glib/ag-account.c b/libaccounts-glib/ag-account.c
+index 8d6995b..7e67ba7 100644
+--- a/libaccounts-glib/ag-account.c
++++ b/libaccounts-glib/ag-account.c
+@@ -994,7 +994,7 @@ ag_account_finalize (GObject *object)
+ if (priv->changes)
+ {
+ DEBUG_INFO ("Finalizing account with uncommitted changes!");
+- g_clear_pointer (&priv->services, _ag_account_changes_free);
++ g_clear_pointer (&priv->changes, _ag_account_changes_free);
+ }
+
+ G_OBJECT_CLASS (ag_account_parent_class)->finalize (object);
+--
+GitLab
+
diff --git a/net-libs/libaccounts-glib/libaccounts-glib-1.26-r1.ebuild b/net-libs/libaccounts-glib/libaccounts-glib-1.26-r1.ebuild
new file mode 100644
index 000000000000..f1bd12d56b46
--- /dev/null
+++ b/net-libs/libaccounts-glib/libaccounts-glib-1.26-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+inherit meson python-r1 vala
+
+DESCRIPTION="Accounts SSO (Single Sign-On) management library for GLib applications"
+HOMEPAGE="https://gitlab.com/accounts-sso/libaccounts-glib"
+SRC_URI="https://gitlab.com/accounts-sso/${PN}/-/archive/VERSION_${PV}/${PN}-VERSION_${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-VERSION_${PV}"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="doc"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+# fails
+RESTRICT="test"
+
+RDEPEND="${PYTHON_DEPS}
+ dev-db/sqlite:3
+ dev-libs/glib:2
+ dev-libs/gobject-introspection:=
+ dev-libs/libxml2
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ $(vala_depend)
+ dev-libs/check
+ dev-util/gdbus-codegen
+ dev-util/glib-utils
+ doc? ( dev-util/gtk-doc )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.25-assert-failure.patch"
+ "${FILESDIR}/${P}-project-version.patch"
+ "${FILESDIR}/${P}-fix-incorrect-cleanup-in-ag_account_finalize.patch"
+)
+
+src_prepare() {
+ default
+ vala_setup --ignore-use
+
+ use doc || sed -e "/^subdir('docs')$/d" -i meson.build || die
+}
+
+src_configure() {
+ python_foreach_impl run_in_build_dir meson_src_configure
+}
+
+src_compile() {
+ python_foreach_impl run_in_build_dir meson_src_compile
+}
+
+src_install() {
+ einstalldocs
+ python_foreach_impl run_in_build_dir meson_src_install
+ python_foreach_impl python_optimize
+}