summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-08-27 10:12:34 +0200
committerRichard Levitte <levitte@openssl.org>2019-08-27 18:55:01 +0200
commitd5f854291336c96a3d2379ecc8c29f00ef516ad9 (patch)
treee98be7d10b42811cf8e77b83ad041fa2c836e0a8 /apps
parent096978f09908ba0f679ff905b0db4861a57eb1c8 (diff)
Coverty fixes for MACs
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9700)
Diffstat (limited to 'apps')
-rw-r--r--apps/list.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/list.c b/apps/list.c
index 0d93f5498f..46a3c29051 100644
--- a/apps/list.c
+++ b/apps/list.c
@@ -133,8 +133,8 @@ static void collect_ciphers(EVP_CIPHER *cipher, void *stack)
{
STACK_OF(EVP_CIPHER) *cipher_stack = stack;
- sk_EVP_CIPHER_push(cipher_stack, cipher);
- EVP_CIPHER_up_ref(cipher);
+ if (sk_EVP_CIPHER_push(cipher_stack, cipher) > 0)
+ EVP_CIPHER_up_ref(cipher);
}
static void list_ciphers(void)
@@ -196,8 +196,8 @@ static void collect_digests(EVP_MD *md, void *stack)
{
STACK_OF(EVP_MD) *digest_stack = stack;
- sk_EVP_MD_push(digest_stack, md);
- EVP_MD_up_ref(md);
+ if (sk_EVP_MD_push(digest_stack, md) > 0)
+ EVP_MD_up_ref(md);
}
static void list_digests(void)
@@ -245,8 +245,8 @@ static void collect_macs(EVP_MAC *mac, void *stack)
{
STACK_OF(EVP_MAC) *mac_stack = stack;
- sk_EVP_MAC_push(mac_stack, mac);
- EVP_MAC_up_ref(mac);
+ if (sk_EVP_MAC_push(mac_stack, mac) > 0)
+ EVP_MAC_up_ref(mac);
}
static void list_macs(void)