summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-02-20 16:42:51 +0100
committerLinus Nordberg <linus@nordu.net>2011-02-20 16:42:51 +0100
commit99a5d4fdb88e21a56843615511f16b164c7b770b (patch)
tree0888d698f80d81b36771c305fda3d7ce6e37c976 /lib
parente0749025f259754aa031d997457a308686136909 (diff)
Handle another ENOMEM case.
Diffstat (limited to 'lib')
-rw-r--r--lib/tls.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/tls.c b/lib/tls.c
index 15929d2..0b3580c 100644
--- a/lib/tls.c
+++ b/lib/tls.c
@@ -14,7 +14,7 @@
#include "../radsecproxy.h"
static struct tls *
-_get_tlsconf (const struct rs_context *ctx, const struct rs_realm *realm)
+_get_tlsconf (struct rs_context *ctx, const struct rs_realm *realm)
{
struct tls *c = rs_malloc (ctx, sizeof (struct tls));
@@ -33,6 +33,8 @@ _get_tlsconf (const struct rs_context *ctx, const struct rs_realm *realm)
c->crlcheck = 0; /* NYI */
c->policyoids = (char **) NULL; /* NYI */
}
+ else
+ rs_err_ctx_push_fl (ctx, RSE_NOMEM, __FILE__, __LINE__, NULL);
return c;
}
@@ -48,7 +50,8 @@ rs_tls_init (struct rs_connection *conn)
ctx = conn->ctx;
tlsconf = _get_tlsconf (ctx, conn->active_peer->realm);
- assert (tlsconf);
+ if (!tlsconf)
+ return -1;
ssl_ctx = tlsgetctx (RADPROT_TLS, tlsconf);
if (!ssl_ctx)
{