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


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

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

crypto/err/err.c:643:1: start of procedure ERR_get_state()
  641.   }
  642.   
  643. > ERR_STATE *ERR_get_state(void)
  644.   {
  645.       ERR_STATE *state = NULL;

crypto/err/err.c:645:5: 
  643.   ERR_STATE *ERR_get_state(void)
  644.   {
  645. >     ERR_STATE *state = NULL;
  646.   
  647.       if (!RUN_ONCE(&err_init, err_do_init))

crypto/err/err.c:647:10: 
  645.       ERR_STATE *state = NULL;
  646.   
  647. >     if (!RUN_ONCE(&err_init, err_do_init))
  648.           return NULL;
  649.   

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:647:10: Condition is false
  645.       ERR_STATE *state = NULL;
  646.   
  647.       if (!RUN_ONCE(&err_init, err_do_init))
                  ^
  648.           return NULL;
  649.   

crypto/err/err.c:647:10: Taking true branch
  645.       ERR_STATE *state = NULL;
  646.   
  647.       if (!RUN_ONCE(&err_init, err_do_init))
                  ^
  648.           return NULL;
  649.   

crypto/err/err.c:648:9: 
  646.   
  647.       if (!RUN_ONCE(&err_init, err_do_init))
  648. >         return NULL;
  649.   
  650.       state = CRYPTO_THREAD_get_local(&err_thread_local);

crypto/err/err.c:668:1: return from a call to ERR_get_state
  666.   
  667.       return state;
  668. > }
  669.   
  670.   int ERR_get_next_error_library(void)

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

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

crypto/err/err.c:379:9: 
377.   
378.       for (i = 0; i < ERR_NUM_ERRORS; i++) {
379. >         err_clear(es, i);
380.       }
381.       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}']