From bde973221fe7eabbf9e0052a9c981f517b1836ed Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Sat, 18 Jan 2020 14:29:05 +0800 Subject: [PATCH] fix bugs of releasing qhandle --- src/system/detail/src/vnodeShell.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/system/detail/src/vnodeShell.c b/src/system/detail/src/vnodeShell.c index 4943eb1da9..4732867d7e 100644 --- a/src/system/detail/src/vnodeShell.c +++ b/src/system/detail/src/vnodeShell.c @@ -215,7 +215,10 @@ void vnodeCloseShellVnode(int vnode) { if (shellList[vnode] == NULL) return; for (int i = 0; i < vnodeList[vnode].cfg.maxSessions; ++i) { - vnodeDecRefCount(shellList[vnode][i].qhandle); + void* qhandle = shellList[vnode][i].qhandle; + if (qhandle != NULL) { + vnodeDecRefCount(qhandle); + } } int32_t* v = malloc(sizeof(int32_t)); -- GitLab