crypto/conf/conf_mod.c:435: error: USE_AFTER_FREE
  call to `module_finish()` eventually accesses memory that was invalidated by call to `free()` on line 435 indirectly during the call to `module_finish()`.
Showing all 20 steps of the trace


crypto/conf/conf_mod.c:433:32: invalidation part of the trace starts here
431.   {
432.       CONF_IMODULE *imod;
433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
                                      ^
434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
435.           module_finish(imod);

crypto/conf/conf_mod.c:433:32: global variable `initialized_modules` accessed here
  431.   {
  432.       CONF_IMODULE *imod;
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
                                        ^
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
  435.           module_finish(imod);

crypto/conf/conf_mod.c:434:16: passed as argument to `sk_CONF_IMODULE_pop`
  432.       CONF_IMODULE *imod;
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                        ^
  435.           module_finish(imod);
  436.       }

crypto/conf/conf_mod.c:434:16: return from call to `sk_CONF_IMODULE_pop`
  432.       CONF_IMODULE *imod;
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                        ^
  435.           module_finish(imod);
  436.       }

crypto/conf/conf_mod.c:434:9: assigned
  432.       CONF_IMODULE *imod;
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                 ^
  435.           module_finish(imod);
  436.       }

crypto/conf/conf_mod.c:435:9: when calling `module_finish` here
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
  435.           module_finish(imod);
                 ^
  436.       }
  437.       sk_CONF_IMODULE_free(initialized_modules);

crypto/conf/conf_mod.c:443:1: parameter `imod` of module_finish
    441.   /* finish a module instance */
    442.   
    443. > static void module_finish(CONF_IMODULE *imod)
    444.   {
    445.       if (!imod)

crypto/conf/conf_mod.c:452:5: when calling `CRYPTO_free` here
    450.       OPENSSL_free(imod->name);
    451.       OPENSSL_free(imod->value);
    452.       OPENSSL_free(imod);
               ^
    453.   }
    454.   

crypto/mem.c:234:1: parameter `str` of CRYPTO_free
      232.   }
      233.   
      234. > void CRYPTO_free(void *str)
      235.   {
      236.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:245:5: was invalidated by call to `free()`
      243.       }
      244.   #else
      245.       free(str);
                 ^
      246.   #endif
      247.   }

crypto/conf/conf_mod.c:433:32: use-after-lifetime part of the trace starts here
431.   {
432.       CONF_IMODULE *imod;
433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
                                      ^
434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
435.           module_finish(imod);

crypto/conf/conf_mod.c:433:32: global variable `initialized_modules` accessed here
  431.   {
  432.       CONF_IMODULE *imod;
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
                                        ^
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
  435.           module_finish(imod);

crypto/conf/conf_mod.c:434:16: passed as argument to `sk_CONF_IMODULE_pop`
  432.       CONF_IMODULE *imod;
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                        ^
  435.           module_finish(imod);
  436.       }

crypto/conf/conf_mod.c:434:16: return from call to `sk_CONF_IMODULE_pop`
  432.       CONF_IMODULE *imod;
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                        ^
  435.           module_finish(imod);
  436.       }

crypto/conf/conf_mod.c:434:9: assigned
  432.       CONF_IMODULE *imod;
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                 ^
  435.           module_finish(imod);
  436.       }

crypto/conf/conf_mod.c:435:9: when calling `module_finish` here
  433.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  434.           imod = sk_CONF_IMODULE_pop(initialized_modules);
  435.           module_finish(imod);
                 ^
  436.       }
  437.       sk_CONF_IMODULE_free(initialized_modules);

crypto/conf/conf_mod.c:443:1: parameter `imod` of module_finish
    441.   /* finish a module instance */
    442.   
    443. > static void module_finish(CONF_IMODULE *imod)
    444.   {
    445.       if (!imod)

crypto/conf/conf_mod.c:452:5: when calling `CRYPTO_free` here
    450.       OPENSSL_free(imod->name);
    451.       OPENSSL_free(imod->value);
    452.       OPENSSL_free(imod);
               ^
    453.   }
    454.   

crypto/mem.c:234:1: parameter `str` of CRYPTO_free
      232.   }
      233.   
      234. > void CRYPTO_free(void *str)
      235.   {
      236.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:245:5: invalid access occurs here
      243.       }
      244.   #else
      245.       free(str);
                 ^
      246.   #endif
      247.   }
