diff options
author | Linus Nordberg <linus@nordu.net> | 2012-04-26 10:17:24 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2012-04-26 10:17:24 +0200 |
commit | c1f196080a7cb867afd3dee50e2910899cbf5f46 (patch) | |
tree | c48ad7c0029d64d2a08cd6bad85569850ebc2011 /lib/examples | |
parent | d4f20d38dc7b65a5d3e7fffa40c5333fdc656584 (diff) |
Handle failing rs_context_create().
Diffstat (limited to 'lib/examples')
-rw-r--r-- | lib/examples/client-blocking.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 <string.h> #include <unistd.h> #include <stdlib.h> +#include <assert.h> #include <event2/event.h> #include <freeradius/libradius.h> #include <radsec/radsec.h> #include <radsec/request.h> +#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) { |