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


crypto/async/async.c:333:1: invalidation part of the trace starts here
331.   }
332.   
333. > static void async_empty_pool(async_pool *pool)
334.   {
335.       ASYNC_JOB *job;

crypto/async/async.c:333:1: parameter `pool` of async_empty_pool
  331.   }
  332.   
  333. > static void async_empty_pool(async_pool *pool)
  334.   {
  335.       ASYNC_JOB *job;

crypto/async/async.c:341:15: passed as argument to `sk_ASYNC_JOB_pop`
  339.   
  340.       do {
  341.           job = sk_ASYNC_JOB_pop(pool->jobs);
                       ^
  342.           async_job_free(job);
  343.       } while (job);

crypto/async/async.c:341:15: return from call to `sk_ASYNC_JOB_pop`
  339.   
  340.       do {
  341.           job = sk_ASYNC_JOB_pop(pool->jobs);
                       ^
  342.           async_job_free(job);
  343.       } while (job);

crypto/async/async.c:341:9: assigned
  339.   
  340.       do {
  341.           job = sk_ASYNC_JOB_pop(pool->jobs);
                 ^
  342.           async_job_free(job);
  343.       } while (job);

crypto/async/async.c:342:9: when calling `async_job_free` here
  340.       do {
  341.           job = sk_ASYNC_JOB_pop(pool->jobs);
  342.           async_job_free(job);
                 ^
  343.       } while (job);
  344.   }

crypto/async/async.c:145:1: parameter `job` of async_job_free
    143.   }
    144.   
    145. > static void async_job_free(ASYNC_JOB *job)
    146.   {
    147.       if (job != NULL) {

crypto/async/async.c:152:9: when calling `CRYPTO_free` here
    150.           async_close_fd(job->wait_fd);
    151.           async_close_fd(job->wake_fd);
    152.           OPENSSL_free(job);
                   ^
    153.       }
    154.   }

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

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

crypto/async/async.c:333:1: use-after-lifetime part of the trace starts here
331.   }
332.   
333. > static void async_empty_pool(async_pool *pool)
334.   {
335.       ASYNC_JOB *job;

crypto/async/async.c:333:1: parameter `pool` of async_empty_pool
  331.   }
  332.   
  333. > static void async_empty_pool(async_pool *pool)
  334.   {
  335.       ASYNC_JOB *job;

crypto/async/async.c:341:15: passed as argument to `sk_ASYNC_JOB_pop`
  339.   
  340.       do {
  341.           job = sk_ASYNC_JOB_pop(pool->jobs);
                       ^
  342.           async_job_free(job);
  343.       } while (job);

crypto/async/async.c:341:15: return from call to `sk_ASYNC_JOB_pop`
  339.   
  340.       do {
  341.           job = sk_ASYNC_JOB_pop(pool->jobs);
                       ^
  342.           async_job_free(job);
  343.       } while (job);

crypto/async/async.c:341:9: assigned
  339.   
  340.       do {
  341.           job = sk_ASYNC_JOB_pop(pool->jobs);
                 ^
  342.           async_job_free(job);
  343.       } while (job);

crypto/async/async.c:342:9: when calling `async_job_free` here
  340.       do {
  341.           job = sk_ASYNC_JOB_pop(pool->jobs);
  342.           async_job_free(job);
                 ^
  343.       } while (job);
  344.   }

crypto/async/async.c:145:1: parameter `job` of async_job_free
    143.   }
    144.   
    145. > static void async_job_free(ASYNC_JOB *job)
    146.   {
    147.       if (job != NULL) {

crypto/async/async.c:152:9: when calling `CRYPTO_free` here
    150.           async_close_fd(job->wait_fd);
    151.           async_close_fd(job->wake_fd);
    152.           OPENSSL_free(job);
                   ^
    153.       }
    154.   }

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

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