crypto/err/err.c:377: error: NULL_DEREFERENCE
  pointer `es` last assigned on line 374 could be null and is dereferenced at line 377, column 9.
Showing all 16 steps of the trace


crypto/err/err.c:369:1: start of procedure ERR_clear_error()
367.   }
368.   
369. > void ERR_clear_error(void)
370.   {
371.       int i;

crypto/err/err.c:374:5: 
372.       ERR_STATE *es;
373.   
374. >     es = ERR_get_state();
375.   
376.       for (i = 0; i < ERR_NUM_ERRORS; i++) {

crypto/err/err.c:638:1: start of procedure ERR_get_state()
  636.   }
  637.   
  638. > ERR_STATE *ERR_get_state(void)
  639.   {
  640.       ERR_STATE *state = NULL;

crypto/err/err.c:640:5: 
  638.   ERR_STATE *ERR_get_state(void)
  639.   {
  640. >     ERR_STATE *state = NULL;
  641.   
  642.       if (!RUN_ONCE(&err_init, err_do_init))

crypto/err/err.c:642:10: 
  640.       ERR_STATE *state = NULL;
  641.   
  642. >     if (!RUN_ONCE(&err_init, err_do_init))
  643.           return NULL;
  644.   

crypto/threads_pthread.c:63:1: start of procedure CRYPTO_THREAD_run_once()
    61.   }
    62.   
    63. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
    64.   {
    65.       if (pthread_once(once, init) != 0)

crypto/threads_pthread.c:65:9: Taking true branch
    63.   int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
    64.   {
    65.       if (pthread_once(once, init) != 0)
                  ^
    66.           return 0;
    67.   

crypto/threads_pthread.c:66:9: 
    64.   {
    65.       if (pthread_once(once, init) != 0)
    66. >         return 0;
    67.   
    68.       return 1;

crypto/threads_pthread.c:69:1: return from a call to CRYPTO_THREAD_run_once
    67.   
    68.       return 1;
    69. > }
    70.   
    71.   int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))

crypto/err/err.c:642:10: Condition is false
  640.       ERR_STATE *state = NULL;
  641.   
  642.       if (!RUN_ONCE(&err_init, err_do_init))
                  ^
  643.           return NULL;
  644.   

crypto/err/err.c:642:10: Taking true branch
  640.       ERR_STATE *state = NULL;
  641.   
  642.       if (!RUN_ONCE(&err_init, err_do_init))
                  ^
  643.           return NULL;
  644.   

crypto/err/err.c:643:9: 
  641.   
  642.       if (!RUN_ONCE(&err_init, err_do_init))
  643. >         return NULL;
  644.   
  645.       state = CRYPTO_THREAD_get_local(&err_thread_local);

crypto/err/err.c:663:1: return from a call to ERR_get_state
  661.   
  662.       return state;
  663. > }
  664.   
  665.   int ERR_get_next_error_library(void)

crypto/err/err.c:376:10: 
374.       es = ERR_get_state();
375.   
376. >     for (i = 0; i < ERR_NUM_ERRORS; i++) {
377.           err_clear(es, i);
378.       }

crypto/err/err.c:376:17: Loop condition is true. Entering loop body
374.       es = ERR_get_state();
375.   
376.       for (i = 0; i < ERR_NUM_ERRORS; i++) {
                       ^
377.           err_clear(es, i);
378.       }

crypto/err/err.c:377:9: 
375.   
376.       for (i = 0; i < ERR_NUM_ERRORS; i++) {
377. >         err_clear(es, i);
378.       }
379.       es->top = es->bottom = 0;

void ERR_clear_error(void)
{
    int i;
    ERR_STATE *es;
    es = ERR_get_state();
    for (i = 0; i < ERR_NUM_ERRORS; i++) {
        err_clear(es, i);
    }
    es->top = es->bottom = 0;
}
['void ERR_clear_error(void)\n{\n    int i;\n    ERR_STATE *es;\n    es = ERR_get_state();\n    for (i = 0; i < ERR_NUM_ERRORS; i++) {\n        err_clear(es, i);\n    }\n    es->top = es->bottom = 0;\n}', 'ERR_STATE *ERR_get_state(void)\n{\n    ERR_STATE *state = NULL;\n    if (!RUN_ONCE(&err_init, err_do_init))\n        return NULL;\n    state = CRYPTO_THREAD_get_local(&err_thread_local);\n    if (state == NULL) {\n        state = OPENSSL_zalloc(sizeof(*state));\n        if (state == NULL)\n            return NULL;\n        if (!CRYPTO_THREAD_set_local(&err_thread_local, state)) {\n            ERR_STATE_free(state);\n            return NULL;\n        }\n        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);\n        ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE);\n    }\n    return state;\n}', 'int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))\n{\n    if (pthread_once(once, init) != 0)\n        return 0;\n    return 1;\n}']