summaryrefslogtreecommitdiff
path: root/lib/examples/client-blocking.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2012-12-17 16:05:55 +0100
committerLinus Nordberg <linus@nordberg.se>2012-12-17 16:05:55 +0100
commita21be6733bfe23998f3aaec00d87d35fe0f1aefa (patch)
treef9a5a3891377756c036744a8fb2b7e42c5b10153 /lib/examples/client-blocking.c
parentbb0ae09c37a03bfe4cdd76ac3527ec5dfe109a8a (diff)
Example code: Don't create rs_error on failing context creation.
We don't export err_create() and the error is ENOMEM nowadays.
Diffstat (limited to 'lib/examples/client-blocking.c')
-rw-r--r--lib/examples/client-blocking.c9
1 files changed, 5 insertions, 4 deletions
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)