Compare commits

..

No commits in common. "fd5f756581093a0f275d56377fe87333aed0d6af" and "db56199192c5d0c633069031873a0338149923bc" have entirely different histories.

2 changed files with 3 additions and 105 deletions

View File

@ -1,77 +0,0 @@
From 64581a94ceeb3f3d3121823fbd309a8c81c8b4fb Mon Sep 17 00:00:00 2001
From: wang xiaomeng <wxiaomeng2016@gmail.com>
Date: Tue, 18 Jul 2023 09:04:19 +0000
Subject: [PATCH] Fix various memory leaks
Valgrind detects various memory leaks in gvfs daemons. Let's fix some of them.
Fixes: https://gitlab.gnome.org/GNOME/gvfs/-/issues/682
---
common/gvfsmountinfo.c | 2 +-
daemon/gvfsbackendnetwork.c | 9 +--------
daemon/gvfsdaemon.c | 3 +++
monitor/gphoto2/ggphoto2volumemonitor.c | 1 +
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/common/gvfsmountinfo.c b/common/gvfsmountinfo.c
index c3f31af..287b9db 100644
--- a/common/gvfsmountinfo.c
+++ b/common/gvfsmountinfo.c
@@ -640,7 +640,7 @@ _g_find_file_insensitive_async (GFile *parent,
G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT,
cancellable,
find_file_insensitive_exists_callback, task);
-
+ g_object_unref (direct_file);
}
diff --git a/daemon/gvfsbackendnetwork.c b/daemon/gvfsbackendnetwork.c
index 87cfec7..50cdc27 100644
--- a/daemon/gvfsbackendnetwork.c
+++ b/daemon/gvfsbackendnetwork.c
@@ -902,14 +902,7 @@ g_vfs_backend_network_init (GVfsBackendNetwork *network_backend)
network_backend->smb_settings = g_settings_new ("org.gnome.system.smb");
current_workgroup = g_settings_get_string (network_backend->smb_settings, "workgroup");
-
- if (current_workgroup == NULL ||
- current_workgroup[0] == 0)
- /* it's okay if current_workgroup is null here,
- * it's checked before the NetworkFile is added anyway. */
- network_backend->current_workgroup = NULL;
- else
- network_backend->current_workgroup = current_workgroup;
+ network_backend->current_workgroup = current_workgroup;
g_signal_connect (network_backend->smb_settings,
"change-event",
diff --git a/daemon/gvfsdaemon.c b/daemon/gvfsdaemon.c
index a6d6236..f659041 100644
--- a/daemon/gvfsdaemon.c
+++ b/daemon/gvfsdaemon.c
@@ -145,6 +145,9 @@ g_vfs_daemon_finalize (GObject *object)
daemon = G_VFS_DAEMON (object);
+ if (daemon->thread_pool != NULL)
+ g_thread_pool_free (daemon->thread_pool, TRUE, FALSE);
+
/* There may be some jobs outstanding if we've been force unmounted. */
if (daemon->jobs)
g_warning ("daemon->jobs != NULL when finalizing daemon!");
diff --git a/monitor/gphoto2/ggphoto2volumemonitor.c b/monitor/gphoto2/ggphoto2volumemonitor.c
index 54dec6e..77d458a 100644
--- a/monitor/gphoto2/ggphoto2volumemonitor.c
+++ b/monitor/gphoto2/ggphoto2volumemonitor.c
@@ -331,6 +331,7 @@ gudev_coldplug_cameras (GGPhoto2VolumeMonitor *monitor)
if (g_udev_device_has_property (d, "ID_GPHOTO2"))
gudev_add_camera (monitor, d, FALSE);
}
+ g_list_free_full (usb_devices, g_object_unref);
}
static GObject *
--
2.33.0

View File

@ -22,17 +22,13 @@
Name: gvfs
Version: 1.50.2
Release: 7
Release: 2
Summary: gvfs is a backends for the gio framework in GLib
License: GPLv3 and LGPLv2+ and BSD and MPLv2.0
URL: https://wiki.gnome.org/Projects/gvfs
Source0: https://download.gnome.org/sources/gvfs/1.50/gvfs-%{version}.tar.xz
# Modify memory leaks patch errors by backporting upstream patch
Patch01: 0001-Fix-memory-leaks-detected-by-valgrind.patch
BuildRequires: /usr/bin/ssh meson gcc libexif-devel gettext-devel docbook-style-xsl chrpath
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gcr-3)
@ -121,9 +117,7 @@ This package containers the headers and other files which are required for devel
chrpath -d %{buildroot}%{_libdir}/gio/modules/*.so
chrpath -d %{buildroot}%{_libdir}/gvfs/*.so
chrpath -d %{buildroot}%{_libexecdir}/gvfs*
mkdir -p %{buildroot}/etc/ld.so.conf.d
echo "%{_libdir}/gio/modules" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
echo "%{_libdir}/gvfs" >> %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
chrpath -d %{buildroot}
# trashlib is GPLv3, include the license
cp -p daemon/trashlib/COPYING COPYING.GPL3
@ -133,10 +127,6 @@ cp -p daemon/trashlib/COPYING COPYING.GPL3
%post
# Reload .mount files:
killall -USR1 gvfsd >&/dev/null || :
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%{_datadir}/dbus-1/services/org.gtk.vfs.*.service
@ -146,6 +136,7 @@ killall -USR1 gvfsd >&/dev/null || :
%{_datadir}/glib-2.0/schemas/*.xml
%{_datadir}/polkit-1/actions/org.gtk.vfs.file-operations.policy
%{_datadir}/polkit-1/rules.d/org.gtk.vfs.file-operations.rules
%{_datadir}/gvfs/remote-volume-monitors/*.monitor
%{_libdir}/gvfs/libgvfsdaemon.so
%{_libexecdir}/gvfs-*
%{_libexecdir}/gvfsd
@ -158,7 +149,6 @@ killall -USR1 gvfsd >&/dev/null || :
%doc NEWS README.md
%{_libdir}/gvfs/libgvfscommon.so
%{_libdir}/gio/modules/*.so
%config(noreplace) /etc/ld.so.conf.d/*
%files devel
%{_includedir}/gvfs-client/gvfs/gvfs*.h
@ -172,21 +162,6 @@ killall -USR1 gvfsd >&/dev/null || :
%{_mandir}/man1/gvfsd-fuse.1*
%changelog
* Wed Apr 17 2024 Huang Yang <huangyang@loongson.cn> - 1.50.2-7
- Fix Error: File listed twice
* Fri Jan 12 2024 wangxiaomeng <wangxiaomeng@kylinos.cn> - 1.50.2-6
- Modify memory-leaks patch errors
* Thu Jul 20 2023 houlifei <houlifei@uniontech.com> - 1.50.2-5
- Fix memory leaks detected by valgrind
* Wed Mar 22 2023 lin zhang <lin.zhang@turbolinux.com.cn> - 1.50.2-4
- add library path file to /etc/ld.so.conf.d
* Mon Mar 13 2023 lin zhang <lin.zhang@turbolinux.com.cn> - 1.50.2-3
- delete invalid line
* Mon Mar 13 2023 lin zhang <lin.zhang@turbolinux.com.cn> - 1.50.2-2
- remove rpath