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


crypto/conf/conf_mod.c:389:32: invalidation part of the trace starts here
387.   {
388.       CONF_IMODULE *imod;
389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
                                      ^
390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
391.           module_finish(imod);

crypto/conf/conf_mod.c:389:32: global variable `initialized_modules` accessed here
  387.   {
  388.       CONF_IMODULE *imod;
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
                                        ^
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
  391.           module_finish(imod);

crypto/conf/conf_mod.c:390:16: passed as argument to `sk_CONF_IMODULE_pop`
  388.       CONF_IMODULE *imod;
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                        ^
  391.           module_finish(imod);
  392.       }

crypto/conf/conf_mod.c:390:16: return from call to `sk_CONF_IMODULE_pop`
  388.       CONF_IMODULE *imod;
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                        ^
  391.           module_finish(imod);
  392.       }

crypto/conf/conf_mod.c:390:9: assigned
  388.       CONF_IMODULE *imod;
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                 ^
  391.           module_finish(imod);
  392.       }

crypto/conf/conf_mod.c:391:9: when calling `module_finish` here
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
  391.           module_finish(imod);
                 ^
  392.       }
  393.       sk_CONF_IMODULE_free(initialized_modules);

crypto/conf/conf_mod.c:399:1: parameter `imod` of module_finish
    397.   /* finish a module instance */
    398.   
    399. > static void module_finish(CONF_IMODULE *imod)
    400.   {
    401.       if (!imod)

crypto/conf/conf_mod.c:408:5: when calling `CRYPTO_free` here
    406.       OPENSSL_free(imod->name);
    407.       OPENSSL_free(imod->value);
    408.       OPENSSL_free(imod);
               ^
    409.   }
    410.   

crypto/mem.c:265:1: parameter `str` of CRYPTO_free
      263.   }
      264.   
      265. > void CRYPTO_free(void *str, const char *file, int line)
      266.   {
      267.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:281:5: was invalidated by call to `free()`
      279.       }
      280.   #else
      281.       free(str);
                 ^
      282.   #endif
      283.   }

crypto/conf/conf_mod.c:389:32: use-after-lifetime part of the trace starts here
387.   {
388.       CONF_IMODULE *imod;
389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
                                      ^
390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
391.           module_finish(imod);

crypto/conf/conf_mod.c:389:32: global variable `initialized_modules` accessed here
  387.   {
  388.       CONF_IMODULE *imod;
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
                                        ^
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
  391.           module_finish(imod);

crypto/conf/conf_mod.c:390:16: passed as argument to `sk_CONF_IMODULE_pop`
  388.       CONF_IMODULE *imod;
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                        ^
  391.           module_finish(imod);
  392.       }

crypto/conf/conf_mod.c:390:16: return from call to `sk_CONF_IMODULE_pop`
  388.       CONF_IMODULE *imod;
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                        ^
  391.           module_finish(imod);
  392.       }

crypto/conf/conf_mod.c:390:9: assigned
  388.       CONF_IMODULE *imod;
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
                 ^
  391.           module_finish(imod);
  392.       }

crypto/conf/conf_mod.c:391:9: when calling `module_finish` here
  389.       while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  390.           imod = sk_CONF_IMODULE_pop(initialized_modules);
  391.           module_finish(imod);
                 ^
  392.       }
  393.       sk_CONF_IMODULE_free(initialized_modules);

crypto/conf/conf_mod.c:399:1: parameter `imod` of module_finish
    397.   /* finish a module instance */
    398.   
    399. > static void module_finish(CONF_IMODULE *imod)
    400.   {
    401.       if (!imod)

crypto/conf/conf_mod.c:408:5: when calling `CRYPTO_free` here
    406.       OPENSSL_free(imod->name);
    407.       OPENSSL_free(imod->value);
    408.       OPENSSL_free(imod);
               ^
    409.   }
    410.   

crypto/mem.c:265:1: parameter `str` of CRYPTO_free
      263.   }
      264.   
      265. > void CRYPTO_free(void *str, const char *file, int line)
      266.   {
      267.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:281:5: invalid access occurs here
      279.       }
      280.   #else
      281.       free(str);
                 ^
      282.   #endif
      283.   }
