加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0005-release-handle-when-dlerror-returns-non-nullptr.patch 967 Bytes
一键复制 编辑 原始数据 按行查看 历史
From 4c6bb127d9b70a31625d3aa58ecea9efea813465 Mon Sep 17 00:00:00 2001
From: Wei Jiangang <wei_jiangang@hoperun.com>
Date: Wed, 29 May 2024 10:53:07 +0800
Subject: [PATCH] release handle when dlerror returns non-nullptr
Signed-off-by: Wei Jiangang <wei_jiangang@hoperun.com>
---
services/service/src/device_manager_service.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/services/service/src/device_manager_service.cpp b/services/service/src/device_manager_service.cpp
index f167f719..b07b8574 100755
--- a/services/service/src/device_manager_service.cpp
+++ b/services/service/src/device_manager_service.cpp
@@ -407,6 +407,7 @@ bool DeviceManagerService::IsDMServiceImplReady()
dlerror();
auto func = (CreateDMServiceFuncPtr)dlsym(so_handle, "CreateDMServiceObject");
if (dlerror() != nullptr || func == nullptr) {
+ dlclose(so_handle);
LOGE("Create object function is not exist.");
return false;
}
--
2.39.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化