Coverity 1414465: Resource leaks (RESOURCE_LEAK)
authorPauli <paul.dale@oracle.com>
Sun, 8 Sep 2019 08:25:34 +0000 (18:25 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 10 Sep 2019 22:27:26 +0000 (08:27 +1000)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9805)

test/evp_test.c

index 2f7506e..1ff90c2 100644 (file)
@@ -2008,8 +2008,10 @@ static int kdf_test_init(EVP_TEST *t, const char *name)
     *kdata->p = OSSL_PARAM_construct_end();
 
     kdf = EVP_KDF_fetch(NULL, name, NULL);
-    if (kdf == NULL)
+    if (kdf == NULL) {
+        OPENSSL_free(kdata);
         return 0;
+    }
     kdata->ctx = EVP_KDF_CTX_new(kdf);
     EVP_KDF_free(kdf);
     if (kdata->ctx == NULL) {