7 Star 0 Fork 19

src-openEuler/libblockdev

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-Fix-leaking-error.patch 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
yanshuai 提交于 2024-05-11 11:10 . Fix leaking error
From 990b4136608ad1ae69e9727ccb16b9ecf88644e5 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Mon, 20 Nov 2023 17:49:46 +0100
Subject: [PATCH] lvm-dbus: Fix leaking error
---
src/plugins/lvm-dbus.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c
index e822bd6..e1a9079 100644
--- a/src/plugins/lvm-dbus.c
+++ b/src/plugins/lvm-dbus.c
@@ -362,10 +362,14 @@ void bd_lvm_close (void) {
/* the check() call should create the DBus connection for us, but let's not
completely rely on it */
- if (!g_dbus_connection_flush_sync (bus, NULL, &error))
+ if (!g_dbus_connection_flush_sync (bus, NULL, &error)) {
bd_utils_log_format (BD_UTILS_LOG_CRIT, "Failed to flush DBus connection: %s", error->message);
- if (!g_dbus_connection_close_sync (bus, NULL, &error))
+ g_clear_error (&error);
+ }
+ if (!g_dbus_connection_close_sync (bus, NULL, &error)) {
bd_utils_log_format (BD_UTILS_LOG_CRIT, "Failed to close DBus connection: %s", error->message);
+ g_clear_error (&error);
+ }
dm_log_with_errno_init (NULL);
dm_log_init_verbose (0);
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/libblockdev.git
git@gitee.com:src-openeuler/libblockdev.git
src-openeuler
libblockdev
libblockdev
master

搜索帮助