Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
if (curr->active)
#endif
{
if (curr->active)
#endif
{
- sk_SSL_CIPHER_push(cipherstack, curr->cipher);
+ if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher))
+ {
+ OPENSSL_free(co_list);
+ sk_SSL_CIPHER_free(cipherstack);
+ return NULL;
+ }
#ifdef CIPHER_DEBUG
printf("<%s>\n",curr->cipher->name);
#endif
#ifdef CIPHER_DEBUG
printf("<%s>\n",curr->cipher->name);
#endif