From c1f196080a7cb867afd3dee50e2910899cbf5f46 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 26 Apr 2012 10:17:24 +0200 Subject: Handle failing rs_context_create(). --- lib/examples/client-blocking.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c index 73c526d..f26cd6c 100644 --- a/lib/examples/client-blocking.c +++ b/lib/examples/client-blocking.c @@ -4,10 +4,12 @@ #include #include #include +#include #include #include #include #include +#include "err.h" #include "debug.h" /* For rs_dump_packet(). */ #define SECRET "sikrit" @@ -25,7 +27,11 @@ blocking_client (const char *config_fn, const char *configuration, struct rs_error *err = NULL; if (rs_context_create (&h)) - return NULL; + { + err = err_create (RSE_INTERNAL, NULL, 0, "unable to create context"); + assert (err != NULL); + return err; + } #if !defined (USE_CONFIG_FILE) { -- cgit v1.1