From d9bbcc2d4f78cf805e215b078a01766be95f1c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Wed, 15 Mar 2023 11:24:17 +0100 Subject: [PATCH] check if log context was created MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pablo HernĂ¡n Carle --- src/main.c | 4 ++++ src/msg.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/main.c b/src/main.c index 0b6a5a8..cf21ce6 100644 --- a/src/main.c +++ b/src/main.c @@ -1535,6 +1535,10 @@ int main(int argc, char **argv) { zl_context.config = config; LoggingContext *logContext = makeLoggingContext(); + if (!logContext) { + ERROR(MSG_NO_LOG_CONTEXT); + exit(EXIT_FAILURE); + } logConfigureStandardDestinations(logContext); ConfigManager *configmgr = makeConfigManager(); /* configs,schemas,1,stderr); */ diff --git a/src/msg.h b/src/msg.h index aabd9cf..db2f15d 100644 --- a/src/msg.h +++ b/src/msg.h @@ -87,6 +87,7 @@ #define MSG_CFG_INTERNAL_FAIL MSG_PREFIX "0071E" " Internal failure during validation, please contact support\n" #define MSG_CFG_LOAD_FAIL MSG_PREFIX "0072E" " Launcher Could not load configurations\n" #define MSG_CFG_SCHEMA_FAIL MSG_PREFIX "0073E" " Launcher Could not load schemas, status=%d\n" +#define MSG_NO_LOG_CONTEXT MSG_PREFIX "0074E" " Log context was not created\n" #endif // MSG_H