coverity 1462548 Resource leak
[openssl.git] / crypto / ffc / ffc_backend.c
index d3661b1..1cfa427 100644 (file)
@@ -31,7 +31,13 @@ int ffc_params_fromdata(FFC_PARAMS *ffc, const OSSL_PARAM params[])
     if (prm != NULL) {
         if (prm->data_type != OSSL_PARAM_UTF8_STRING)
             goto err;
+#ifndef OPENSSL_NO_DH
+        /*
+         * In a no-dh build we just go straight to err because we have no
+         * support for this.
+         */
         if (!ffc_set_group_pqg(ffc, prm->data))
+#endif
             goto err;
     }
 
@@ -57,11 +63,8 @@ int ffc_params_fromdata(FFC_PARAMS *ffc, const OSSL_PARAM params[])
         ffc->pcounter = i;
     }
     prm = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_COFACTOR);
-    if (prm != NULL) {
-        if (!OSSL_PARAM_get_BN(prm, &j))
-            goto err;
-        j = NULL;
-    }
+    if (prm != NULL && !OSSL_PARAM_get_BN(prm, &j))
+        goto err;
     prm = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_H);
     if (prm != NULL) {
         if (!OSSL_PARAM_get_int(prm, &i))