/* x509spki.c */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
/* ====================================================================
NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len)
{
- unsigned char *spki_der, *p;
+ unsigned char *spki_der;
+ const unsigned char *p;
int spki_len;
NETSCAPE_SPKI *spki;
if(len <= 0) len = strlen(str);
b64_str = OPENSSL_malloc(der_len * 2);
if(!der_spki || !b64_str) {
X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE);
+ if (der_spki != NULL)
+ OPENSSL_free(der_spki);
+ if (b64_str != NULL)
+ OPENSSL_free(b64_str);
return NULL;
}
p = der_spki;