summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/hx509/collector.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-06-13 05:44:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:53:18 -0500
commit91adebe749beb0dc23cacaea316cb2b724776aad (patch)
tree133d480f5b23b99fcf1149861136103dc4525cb1 /source4/heimdal/lib/hx509/collector.c
parentf7110d928afd61cee203d07fd85968af993a327f (diff)
downloadsamba-91adebe749beb0dc23cacaea316cb2b724776aad.tar.gz
samba-91adebe749beb0dc23cacaea316cb2b724776aad.tar.bz2
samba-91adebe749beb0dc23cacaea316cb2b724776aad.zip
r23456: Update Samba4 to current lorikeet-heimdal.
Andrew Bartlett (This used to be commit ae0f81ab235c72cceb120bcdeb051a483cf3cc4f)
Diffstat (limited to 'source4/heimdal/lib/hx509/collector.c')
-rw-r--r--source4/heimdal/lib/hx509/collector.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source4/heimdal/lib/hx509/collector.c b/source4/heimdal/lib/hx509/collector.c
index ec172f46f4..8b6ffcb945 100644
--- a/source4/heimdal/lib/hx509/collector.c
+++ b/source4/heimdal/lib/hx509/collector.c
@@ -32,7 +32,7 @@
*/
#include "hx_locl.h"
-RCSID("$Id: collector.c,v 1.16 2007/01/09 10:52:04 lha Exp $");
+RCSID("$Id: collector.c 20778 2007-06-01 22:04:13Z lha $");
struct private_key {
AlgorithmIdentifier alg;
@@ -51,22 +51,26 @@ struct hx509_collector {
};
-struct hx509_collector *
-_hx509_collector_alloc(hx509_context context, hx509_lock lock)
+int
+_hx509_collector_alloc(hx509_context context, hx509_lock lock, struct hx509_collector **collector)
{
struct hx509_collector *c;
int ret;
+ *collector = NULL;
+
c = calloc(1, sizeof(*c));
- if (c == NULL)
- return NULL;
+ if (c == NULL) {
+ hx509_set_error_string(context, 0, ENOMEM, "out of memory");
+ return ENOMEM;
+ }
c->lock = lock;
ret = hx509_certs_init(context, "MEMORY:collector-unenvelop-cert",
0,NULL, &c->unenvelop_certs);
if (ret) {
free(c);
- return NULL;
+ return ret;
}
c->val.data = NULL;
c->val.len = 0;
@@ -75,10 +79,11 @@ _hx509_collector_alloc(hx509_context context, hx509_lock lock)
if (ret) {
hx509_certs_free(&c->unenvelop_certs);
free(c);
- return NULL;
+ return ret;
}
- return c;
+ *collector = c;
+ return 0;
}
hx509_lock