From a21be6733bfe23998f3aaec00d87d35fe0f1aefa Mon Sep 17 00:00:00 2001
From: Linus Nordberg <linus@nordberg.se>
Date: Mon, 17 Dec 2012 16:05:55 +0100
Subject: Example code: Don't create rs_error on failing context creation.

We don't export err_create() and the error is ENOMEM nowadays.
---
 lib/examples/client-blocking.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'lib')

diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c
index 7d3869a..7ba71a0 100644
--- a/lib/examples/client-blocking.c
+++ b/lib/examples/client-blocking.c
@@ -25,12 +25,13 @@ blocking_client (const char *config_fn, const char *configuration,
   struct rs_request *request = NULL;
   struct rs_packet *req = NULL, *resp = NULL;
   struct rs_error *err = NULL;
+  int r;
 
-  if (rs_context_create (&h))
+  r = rs_context_create (&h);
+  if (r)
     {
-      err = err_create (RSE_INTERNAL, NULL, 0, "unable to create context");
-      assert (err != NULL);
-      return err;
+      assert(r == RSE_NOMEM);
+      assert (!"out of RAM -- unable to create libradsec context");
     }
 
 #if !defined (USE_CONFIG_FILE)
-- 
cgit v1.1