coverity: NULL dereference
authorPauli <pauli@openssl.org>
Tue, 19 Sep 2023 01:07:21 +0000 (11:07 +1000)
committerPauli <pauli@openssl.org>
Wed, 20 Sep 2023 03:31:45 +0000 (13:31 +1000)
Fixes coverity 1544699.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/22138)

(cherry picked from commit be01f609f98a8930f2c91b813715e515a88f4d54)

crypto/engine/eng_table.c

index 3138a1526002a70af59791d082e2746059440005..9dc3144bbfd7b610c1cd73f056a9c7a0ea862bc8 100644 (file)
@@ -97,6 +97,7 @@ int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
     if (added && !engine_cleanup_add_first(cleanup)) {
         lh_ENGINE_PILE_free(&(*table)->piles);
         *table = NULL;
+        goto end;
     }
     while (num_nids--) {
         tmplate.nid = *nids;