coverity 1520506: error handling
authorPauli <pauli@openssl.org>
Wed, 25 Jan 2023 01:06:23 +0000 (12:06 +1100)
committerPauli <pauli@openssl.org>
Sun, 29 Jan 2023 21:34:16 +0000 (08:34 +1100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/20132)

test/cmp_asn_test.c

index 7175362934a03add49703b9a0909f2402ff4fe11..838bf1947488d01cc77fb6c4de8eb182f1a6cc29 100644 (file)
@@ -47,7 +47,10 @@ static int execute_cmp_asn1_get_int_test(CMP_ASN_TEST_FIXTURE *fixture)
 
     if (!TEST_ptr(asn1integer))
         return 0;
-    ASN1_INTEGER_set(asn1integer, 77);
+    if (!TEST_true(ASN1_INTEGER_set(asn1integer, 77))) {
+        ASN1_INTEGER_free(asn1integer);
+        return 0;
+    }
     res = TEST_int_eq(77, ossl_cmp_asn1_get_int(asn1integer));
     ASN1_INTEGER_free(asn1integer);
     return res;