1 Star 0 Fork 44

严莹/iSulad

forked from src-openEuler/iSulad 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0114-bugfix-for-null-pointer-reference.patch 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
zhongtao 提交于 2024-08-19 10:17 . add impl for nri and bugfix
From 701180b53d1c52376f753b94c5cf09987ae789b3 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Tue, 18 Jun 2024 16:02:25 +0800
Subject: [PATCH 114/121] bugfix for null pointer reference
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/daemon/entry/connect/grpc/grpc_service.cc | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/daemon/entry/connect/grpc/grpc_service.cc b/src/daemon/entry/connect/grpc/grpc_service.cc
index 1d8de922..300af082 100644
--- a/src/daemon/entry/connect/grpc/grpc_service.cc
+++ b/src/daemon/entry/connect/grpc/grpc_service.cc
@@ -100,7 +100,9 @@ public:
{
// Wait for the server to shutdown. Note that some other thread must be
// responsible for shutting down the server for this call to ever return.
- m_server->Wait();
+ if (m_server != nullptr) {
+ m_server->Wait();
+ }
// Wait for stream server to shutdown
m_criService.Wait();
@@ -109,7 +111,9 @@ public:
void Shutdown(void)
{
// call CRI to shutdown stream server, shutdown cri first to notify events thread to exit
- m_criService.Shutdown();
+ if (m_server != nullptr) {
+ m_server->Shutdown();
+ }
m_server->Shutdown();
@@ -242,10 +246,16 @@ int grpc_server_init(const struct service_arguments *args)
void grpc_server_wait(void)
{
+ if (g_grpcserver == nullptr) {
+ return;
+ }
g_grpcserver->Wait();
}
void grpc_server_shutdown(void)
{
+ if (g_grpcserver == nullptr) {
+ return;
+ }
g_grpcserver->Shutdown();
}
--
2.25.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yanyir/iSulad.git
git@gitee.com:yanyir/iSulad.git
yanyir
iSulad
iSulad
master

搜索帮助