crypto/engine/eng_table.c:128: error: USE_AFTER_FREE
  call to `engine_unlocked_init()` eventually accesses memory that was invalidated by call to `free()` on line 134 indirectly during the call to `engine_unlocked_finish()`.
Showing all 15 steps of the trace


crypto/engine/eng_table.c:82:1: invalidation part of the trace starts here
80.    * ENGINEs from the implementation table
81.    */
82. > int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
83.                             ENGINE *e, const int *nids, int num_nids,
84.                             int setdefault)

crypto/engine/eng_table.c:82:1: parameter `e` of engine_table_register
  80.    * ENGINEs from the implementation table
  81.    */
  82. > int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
  83.                             ENGINE *e, const int *nids, int num_nids,
  84.                             int setdefault)

crypto/engine/eng_table.c:135:13: assigned
  133.               if (fnd->funct)
  134.                   engine_unlocked_finish(fnd->funct, 0);
  135.               fnd->funct = e;
                     ^
  136.               fnd->uptodate = 1;
  137.           }

crypto/engine/eng_table.c:134:17: when calling `engine_unlocked_finish` here
  132.               }
  133.               if (fnd->funct)
  134.                   engine_unlocked_finish(fnd->funct, 0);
                         ^
  135.               fnd->funct = e;
  136.               fnd->uptodate = 1;

crypto/engine/eng_init.c:44:1: parameter `e` of engine_unlocked_finish
    42.    * internally.
    43.    */
    44. > int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers)
    45.   {
    46.       int to_return = 1;

crypto/engine/eng_init.c:69:10: when calling `engine_free_util` here
    67.       REF_ASSERT_ISNT(e->funct_ref < 0);
    68.       /* Release the structural reference too */
    69.       if (!engine_free_util(e, 0)) {
                   ^
    70.           ENGINEerr(ENGINE_F_ENGINE_UNLOCKED_FINISH, ENGINE_R_FINISH_FAILED);
    71.           return 0;

crypto/engine/eng_lib.c:71:1: parameter `e` of engine_free_util
      69.   }
      70.   
      71. > int engine_free_util(ENGINE *e, int not_locked)
      72.   {
      73.       int i;

crypto/engine/eng_lib.c:99:5: when calling `CRYPTO_free` here
      97.           e->destroy(e);
      98.       CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ENGINE, e, &e->ex_data);
      99.       OPENSSL_free(e);
                 ^
      100.       return 1;
      101.   }

crypto/mem.c:295:1: parameter `str` of CRYPTO_free
        293.   }
        294.   
        295. > void CRYPTO_free(void *str, const char *file, int line)
        296.   {
        297.       INCREMENT(free_count);

crypto/mem.c:312:5: was invalidated by call to `free()`
        310.       }
        311.   #else
        312.       free(str);
                   ^
        313.   #endif
        314.   }

crypto/engine/eng_table.c:82:1: use-after-lifetime part of the trace starts here
80.    * ENGINEs from the implementation table
81.    */
82. > int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
83.                             ENGINE *e, const int *nids, int num_nids,
84.                             int setdefault)

crypto/engine/eng_table.c:82:1: parameter `e` of engine_table_register
  80.    * ENGINEs from the implementation table
  81.    */
  82. > int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
  83.                             ENGINE *e, const int *nids, int num_nids,
  84.                             int setdefault)

crypto/engine/eng_table.c:128:18: when calling `engine_unlocked_init` here
  126.           fnd->uptodate = 0;
  127.           if (setdefault) {
  128.               if (!engine_unlocked_init(e)) {
                          ^
  129.                   ENGINEerr(ENGINE_F_ENGINE_TABLE_REGISTER,
  130.                             ENGINE_R_INIT_FAILED);

crypto/engine/eng_init.c:17:1: parameter `e` of engine_unlocked_init
    15.    * it's already in use). This version is only used internally.
    16.    */
    17. > int engine_unlocked_init(ENGINE *e)
    18.   {
    19.       int to_return = 1;

crypto/engine/eng_init.c:33:9: invalid access occurs here
    31.            */
    32.           e->struct_ref++;
    33.           e->funct_ref++;
                  ^
    34.           engine_ref_debug(e, 0, 1);
    35.           engine_ref_debug(e, 1, 1);
