14 Star 0 Fork 25

src-openEuler/gvfs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-onedrive-Fix-memory-leaks.patch 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
zhangxingrong 提交于 2024-07-17 14:24 . add some upstream patchs
From 87ef2d97a7124c012f9373eef3342db08e357fc1 Mon Sep 17 00:00:00 2001
From: Jan-Michael Brummer <jan-michael.brummer1@volkswagen.de>
Date: Thu, 13 Jun 2024 23:13:23 +0200
Subject: [PATCH] onedrive: Fix memory leaks
Relates: https://gitlab.gnome.org/GNOME/gvfs/-/issues/742
---
daemon/gvfsbackendonedrive.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/daemon/gvfsbackendonedrive.c b/daemon/gvfsbackendonedrive.c
index c09dcb6b..e1278431 100644
--- a/daemon/gvfsbackendonedrive.c
+++ b/daemon/gvfsbackendonedrive.c
@@ -630,7 +630,9 @@ resolve (GVfsBackendOnedrive *self,
if (out_path != NULL)
{
- *out_path = g_build_path ("/", *out_path, msg_drive_item_get_id (ret_val), NULL);
+ char *tmp = g_build_path ("/", *out_path, msg_drive_item_get_id (ret_val), NULL);
+ g_free (*out_path);
+ *out_path = tmp;
}
out:
@@ -1108,7 +1110,7 @@ g_vfs_backend_onedrive_mount (GVfsBackend *_self,
GMountSpec *real_mount_spec;
GError *error = NULL;
GList *accounts = NULL;
- GList *drives;
+ g_autolist (MsgDrive) drives = NULL;
GList *l = NULL;
const char *host = NULL;
@@ -1198,6 +1200,7 @@ g_vfs_backend_onedrive_mount (GVfsBackend *_self,
real_mount_spec = g_mount_spec_new ("onedrive");
g_mount_spec_set (real_mount_spec, "host", self->account_identity);
g_vfs_backend_set_mount_spec (_self, real_mount_spec);
+ g_mount_spec_unref (real_mount_spec);
g_vfs_backend_set_display_name (_self, self->account_identity);
g_vfs_job_succeeded (G_VFS_JOB (job));
@@ -1872,8 +1875,6 @@ g_vfs_backend_onedrive_dispose (GObject *_self)
{
GVfsBackendOnedrive *self = G_VFS_BACKEND_ONEDRIVE (_self);
- g_clear_object (&self->client);
-
g_clear_object (&self->service);
g_clear_object (&self->root);
g_clear_object (&self->home);
--
GitLab
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/gvfs.git
git@gitee.com:src-openeuler/gvfs.git
src-openeuler
gvfs
gvfs
master

搜索帮助