--- openconnect-5.03/gnutls.c~ 2014-02-03 14:11:19 +0100 +++ openconnect-5.03/gnutls.c 2014-04-12 18:14:56 +0200 @@ -501,8 +501,6 @@ static int assign_privkey(struct opencon unsigned int nr_certs, uint8_t *free_certs) { - int i; - vpninfo->my_certs = gnutls_calloc(nr_certs, sizeof(*certs)); if (!vpninfo->my_certs) return GNUTLS_E_MEMORY_ERROR; @@ -1004,6 +1002,8 @@ static int load_certificate(struct openc cert = supporting_certs[0]; free_supporting_certs = gnutls_malloc(nr_supporting_certs); if (!free_supporting_certs) { + vpn_progress(vpninfo, PRG_ERR, + _("Failed to allocate memory for supporting certificates\n")); ret = -ENOMEM; goto out; } @@ -1437,7 +1437,7 @@ static int load_certificate(struct openc supporting_certs = gnutls_malloc(sizeof(*supporting_certs)); if (!supporting_certs) { vpn_progress(vpninfo, PRG_ERR, - _("Failed to allocate memory for certificate\n")); + _("Failed to allocate memory for supporting certificates\n")); ret = -ENOMEM; goto out; } @@ -1447,7 +1447,7 @@ static int load_certificate(struct openc free_supporting_certs = gnutls_malloc(1); if (!free_supporting_certs) { vpn_progress(vpninfo, PRG_ERR, - _("Failed to allocate memory for certificate\n")); + _("Failed to allocate memory for supporting certificates\n")); ret = -ENOMEM; goto out; } @@ -1514,9 +1514,9 @@ static int load_certificate(struct openc gnutls_free(t.data); } #endif + if (err) break; - } if (gnutls_x509_crt_check_issuer(issuer, issuer)) {