From def99aff7ffcaacc279a52fd9f17bcf74990ee0d Mon Sep 17 00:00:00 2001 From: Bostjan Meglic Date: Tue, 23 Aug 2022 08:33:45 +0000 Subject: [PATCH] [SMF] Fix abort on app exit when no Diameter configuration In case that SMF was configured to run without Diameter, it would crash on application exit due to uninitialized variables/pointers. ERROR pid:unnamed in fd_sess_handler_destroy@sessions.c:324: ERROR: Invalid parameter '(handler && ( ((*handler) != ((void *)0)) && ( ((struct session_handler *)(*handler))->eyec == 0x53554AD1) ))', 22 [smf] FATAL: smf_gx_final: Assertion `ret == 0' failed. (../src/smf/gx-path.c:1353) --- src/smf/fd-path.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/smf/fd-path.c b/src/smf/fd-path.c index cca7fd5dc..eb243af7c 100644 --- a/src/smf/fd-path.c +++ b/src/smf/fd-path.c @@ -54,6 +54,13 @@ int smf_fd_init(void) void smf_fd_final(void) { + if (smf_self()->diam_conf_path == NULL && + (smf_self()->diam_config->cnf_diamid == NULL || + smf_self()->diam_config->cnf_diamrlm == NULL || + smf_self()->diam_config->cnf_addr == NULL)) { + return; + } + smf_gx_final(); smf_s6b_final();