From: Linus Nordberg Date: Mon, 17 Dec 2012 15:05:55 +0000 (+0100) Subject: Example code: Don't create rs_error on failing context creation. X-Git-Tag: libradsec-0.0.4~61^2~13 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=libradsec.git;a=commitdiff_plain;h=a21be6733bfe23998f3aaec00d87d35fe0f1aefa Example code: Don't create rs_error on failing context creation. We don't export err_create() and the error is ENOMEM nowadays. --- 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)