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


crypto/async/async.c:322:1: invalidation part of the trace starts here
320.   }
321.   
322. > static void async_empty_pool(async_pool *pool)
323.   {
324.       ASYNC_JOB *job;

crypto/async/async.c:322:1: parameter `pool` of async_empty_pool
  320.   }
  321.   
  322. > static void async_empty_pool(async_pool *pool)
  323.   {
  324.       ASYNC_JOB *job;

crypto/async/async.c:330:15: passed as argument to `sk_ASYNC_JOB_pop`
  328.   
  329.       do {
  330.           job = sk_ASYNC_JOB_pop(pool->jobs);
                       ^
  331.           async_job_free(job);
  332.       } while (job);

crypto/async/async.c:330:15: return from call to `sk_ASYNC_JOB_pop`
  328.   
  329.       do {
  330.           job = sk_ASYNC_JOB_pop(pool->jobs);
                       ^
  331.           async_job_free(job);
  332.       } while (job);

crypto/async/async.c:330:9: assigned
  328.   
  329.       do {
  330.           job = sk_ASYNC_JOB_pop(pool->jobs);
                 ^
  331.           async_job_free(job);
  332.       } while (job);

crypto/async/async.c:331:9: when calling `async_job_free` here
  329.       do {
  330.           job = sk_ASYNC_JOB_pop(pool->jobs);
  331.           async_job_free(job);
                 ^
  332.       } while (job);
  333.   }

crypto/async/async.c:139:1: parameter `job` of async_job_free
    137.   }
    138.   
    139. > static void async_job_free(ASYNC_JOB *job)
    140.   {
    141.       if (job != NULL) {

crypto/async/async.c:146:9: when calling `CRYPTO_free` here
    144.           async_close_fd(job->wait_fd);
    145.           async_close_fd(job->wake_fd);
    146.           OPENSSL_free(job);
                   ^
    147.       }
    148.   }

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/async/async.c:322:1: use-after-lifetime part of the trace starts here
320.   }
321.   
322. > static void async_empty_pool(async_pool *pool)
323.   {
324.       ASYNC_JOB *job;

crypto/async/async.c:322:1: parameter `pool` of async_empty_pool
  320.   }
  321.   
  322. > static void async_empty_pool(async_pool *pool)
  323.   {
  324.       ASYNC_JOB *job;

crypto/async/async.c:330:15: passed as argument to `sk_ASYNC_JOB_pop`
  328.   
  329.       do {
  330.           job = sk_ASYNC_JOB_pop(pool->jobs);
                       ^
  331.           async_job_free(job);
  332.       } while (job);

crypto/async/async.c:330:15: return from call to `sk_ASYNC_JOB_pop`
  328.   
  329.       do {
  330.           job = sk_ASYNC_JOB_pop(pool->jobs);
                       ^
  331.           async_job_free(job);
  332.       } while (job);

crypto/async/async.c:330:9: assigned
  328.   
  329.       do {
  330.           job = sk_ASYNC_JOB_pop(pool->jobs);
                 ^
  331.           async_job_free(job);
  332.       } while (job);

crypto/async/async.c:331:9: when calling `async_job_free` here
  329.       do {
  330.           job = sk_ASYNC_JOB_pop(pool->jobs);
  331.           async_job_free(job);
                 ^
  332.       } while (job);
  333.   }

crypto/async/async.c:139:1: parameter `job` of async_job_free
    137.   }
    138.   
    139. > static void async_job_free(ASYNC_JOB *job)
    140.   {
    141.       if (job != NULL) {

crypto/async/async.c:146:9: when calling `CRYPTO_free` here
    144.           async_close_fd(job->wait_fd);
    145.           async_close_fd(job->wake_fd);
    146.           OPENSSL_free(job);
                   ^
    147.       }
    148.   }

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.   }
