summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerhard Roth <gerhard@cvs.openbsd.org>2014-03-07 07:19:43 +0000
committerGerhard Roth <gerhard@cvs.openbsd.org>2014-03-07 07:19:43 +0000
commit06309e89eea80e7cdc114999eef02e3bbf7f39f5 (patch)
treebe50c4f920b97bed144a63a75165061b6d4906d9
parentbe2612008efcc299f93076d3a4b35879ca3b22bc (diff)
If allocation of 'id' fails, don't try to deref it after 'goto fail'.
ok millert@
-rw-r--r--sbin/isakmpd/x509.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/isakmpd/x509.c b/sbin/isakmpd/x509.c
index 34e9d398b50..86b02874b0c 100644
--- a/sbin/isakmpd/x509.c
+++ b/sbin/isakmpd/x509.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.c,v 1.115 2013/11/14 15:44:06 deraadt Exp $ */
+/* $OpenBSD: x509.c,v 1.116 2014/03/07 07:19:42 gerhard Exp $ */
/* $EOM: x509.c,v 1.54 2001/01/16 18:42:16 ho Exp $ */
/*
@@ -1153,6 +1153,7 @@ x509_cert_get_subjects(void *scert, int *cnt, u_int8_t ***id,
if (!*id) {
log_print("x509_cert_get_subject: malloc (%lu) failed",
*cnt * (unsigned long)sizeof **id);
+ *cnt = 0;
goto fail;
}
*id_len = calloc(*cnt, sizeof **id_len);