ncurves = SSL_get1_curves(s, NULL);
if (ncurves <= 0)
return 1;
- curves = OPENSSL_malloc(ncurves * sizeof(int));
- if (!curves) {
- BIO_printf(out, "Out of memory\n");
- return 0;
- }
+ curves = app_malloc(ncurves * sizeof(int), "curves to print");
SSL_get1_curves(s, curves);
BIO_puts(out, "Supported Elliptic Curves: ");
OPENSSL_assert(0);
break;
}
- buffer = OPENSSL_malloc(length);
-
- if (buffer == NULL) {
- BIO_printf(bio_err, "out of memory\n");
- return 0;
- }
+ buffer = app_malloc(length, "cookie generate buffer");
switch (peer.sa.sa_family) {
case AF_INET:
OPENSSL_assert(0);
break;
}
- buffer = OPENSSL_malloc(length);
-
- if (buffer == NULL) {
- BIO_printf(bio_err, "out of memory\n");
- return 0;
- }
+ buffer = app_malloc(length, "cookie verify buffer");
switch (peer.sa.sa_family) {
case AF_INET:
static int ssl_excert_prepend(SSL_EXCERT **pexc)
{
- SSL_EXCERT *exc;
- exc = OPENSSL_malloc(sizeof(SSL_EXCERT));
- if (!exc)
- return 0;
+ SSL_EXCERT *exc = app_malloc(sizeof(*exc), "prepend cert");
+
exc->certfile = NULL;
exc->keyfile = NULL;
exc->chainfile = NULL;
void ssl_excert_free(SSL_EXCERT *exc)
{
SSL_EXCERT *curr;
+
+ if (!exc)
+ return;
while (exc) {
X509_free(exc->cert);
EVP_PKEY_free(exc->key);
err:
ERR_print_errors(bio_err);
- if (exc)
- ssl_excert_free(exc);
+ ssl_excert_free(exc);
*pexc = NULL;
return 0;
}