coverity 1462562 Dereference before null check
[openssl.git] / test / drbg_extra_test.c
index 642f7449320267f5a28b2a849a2b0130e2a91da6..e7c0d77d7f60680cb4744626f12c5cbc6a139a52 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
  *
- * Licensed under the OpenSSL license (the "License").  You may not use
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
@@ -75,10 +75,8 @@ static int run_extra_kat(const struct drbg_extra_kat *td)
         failures++;
 
 err:
-    if (drbg != NULL) {
-        RAND_DRBG_uninstantiate(drbg);
-        RAND_DRBG_free(drbg);
-    }
+    RAND_DRBG_uninstantiate(drbg);
+    RAND_DRBG_free(drbg);
     return failures == 0;
 }