check before use daemon->shm_info (#1229)

fix core after the command `unbound-control stop unbound`

fix:https://github.com/NLnetLabs/unbound/issues/1228

Signed-off-by: eaglegai <eaglegai@163.com>
This commit is contained in:
eaglegai
2025-01-21 15:47:51 +01:00
committed by GitHub
parent f822042cd0
commit 073c7301eb
+1 -1
View File
@@ -195,7 +195,7 @@ void shm_main_shutdown(struct daemon* daemon)
{
#ifdef HAVE_SHMGET
/* web are OK, just disabled */
if(!daemon->cfg->shm_enable)
if(!daemon->cfg->shm_enable || !daemon->shm_info)
return;
verbose(VERB_DETAIL, "SHM shutdown - KEY [%d] - ID CTL [%d] ARR [%d] - PTR CTL [%p] ARR [%p]",