From c1f196080a7cb867afd3dee50e2910899cbf5f46 Mon Sep 17 00:00:00 2001
From: Linus Nordberg <linus@nordu.net>
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(-)

(limited to 'lib')

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)
   {
-- 
cgit v1.1