client session BUGFIX be ready for context creation fail
Although it should not happen under standard conditions.
diff --git a/src/session_client_tls.c b/src/session_client_tls.c
index 575fd95..37f9d4e 100644
--- a/src/session_client_tls.c
+++ b/src/session_client_tls.c
@@ -561,6 +561,11 @@
} else {
ctx = ly_ctx_new(SCHEMAS_DIR);
}
+ /* definitely should not happen, but be ready */
+ if (!ctx && !(ctx = ly_ctx_new(NULL))) {
+ /* that's just it */
+ goto fail;
+ }
} else {
session->flags |= NC_SESSION_SHAREDCTX;
}
@@ -626,6 +631,11 @@
} else {
ctx = ly_ctx_new(SCHEMAS_DIR);
}
+ /* definitely should not happen, but be ready */
+ if (!ctx && !(ctx = ly_ctx_new(NULL))) {
+ /* that's just it */
+ goto fail;
+ }
} else {
session->flags |= NC_SESSION_SHAREDCTX;
}