crypto/ct/ct_log.c:201: error: NULL_DEREFERENCE
  pointer `load_ctx` last assigned on line 199 could be null and is dereferenced at line 201, column 5.
Showing all 25 steps of the trace


crypto/ct/ct_log.c:195:1: start of procedure CTLOG_STORE_load_file()
193.   }
194.   
195. > int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file)
196.   {
197.       int ret = 0;

crypto/ct/ct_log.c:197:5: 
195.   int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file)
196.   {
197. >     int ret = 0;
198.       char *enabled_logs;
199.       CTLOG_STORE_LOAD_CTX* load_ctx = ctlog_store_load_ctx_new();

crypto/ct/ct_log.c:199:5: 
197.       int ret = 0;
198.       char *enabled_logs;
199. >     CTLOG_STORE_LOAD_CTX* load_ctx = ctlog_store_load_ctx_new();
200.   
201.       load_ctx->log_store = store;

crypto/ct/ct_log.c:57:1: start of procedure ctlog_store_load_ctx_new()
  55.   static void ctlog_store_load_ctx_free(CTLOG_STORE_LOAD_CTX* ctx);
  56.   
  57. > static CTLOG_STORE_LOAD_CTX *ctlog_store_load_ctx_new()
  58.   {
  59.       CTLOG_STORE_LOAD_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));

crypto/ct/ct_log.c:59:5: 
  57.   static CTLOG_STORE_LOAD_CTX *ctlog_store_load_ctx_new()
  58.   {
  59. >     CTLOG_STORE_LOAD_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  60.   
  61.       if (ctx == NULL)

crypto/mem.c:197:1: start of procedure CRYPTO_zalloc()
    195.   }
    196.   
    197. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:199:5: 
    197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199. >     void *ret = CRYPTO_malloc(num, file, line);
    200.   
    201.       FAILTEST();

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
      167.   #endif
      168.   
      169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171.       void *ret = NULL;

crypto/mem.c:171:5: 
      169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171. >     void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking false branch
      171.       void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      174.           return malloc_impl(num, file, line);
      175.   

crypto/mem.c:176:9: Taking false branch
      174.           return malloc_impl(num, file, line);
      175.   
      176.       if (num == 0)
                     ^
      177.           return NULL;
      178.   

crypto/mem.c:180:5: 
      178.   
      179.       FAILTEST();
      180. >     allow_customize = 0;
      181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
      188.       }
      189.   #else
      190. >     (void)(file); (void)(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:190:19: 
      188.       }
      189.   #else
      190. >     (void)(file); (void)(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:191:5: 
      189.   #else
      190.       (void)(file); (void)(line);
      191. >     ret = malloc(num);
      192.   #endif
      193.   

crypto/mem.c:194:5: 
      192.   #endif
      193.   
      194. >     return ret;
      195.   }
      196.   

crypto/mem.c:195:1: return from a call to CRYPTO_malloc
      193.   
      194.       return ret;
      195. > }
      196.   
      197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:202:9: Taking false branch
    200.   
    201.       FAILTEST();
    202.       if (ret != NULL)
                   ^
    203.           memset(ret, 0, num);
    204.       return ret;

crypto/mem.c:204:5: 
    202.       if (ret != NULL)
    203.           memset(ret, 0, num);
    204. >     return ret;
    205.   }
    206.   

crypto/mem.c:205:1: return from a call to CRYPTO_zalloc
    203.           memset(ret, 0, num);
    204.       return ret;
    205. > }
    206.   
    207.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/ct/ct_log.c:61:9: Taking true branch
  59.       CTLOG_STORE_LOAD_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  60.   
  61.       if (ctx == NULL)
                ^
  62.           CTerr(CT_F_CTLOG_STORE_LOAD_CTX_NEW, ERR_R_MALLOC_FAILURE);
  63.   

crypto/ct/ct_log.c:62:9: Skipping ERR_put_error(): empty list of specs
  60.   
  61.       if (ctx == NULL)
  62.           CTerr(CT_F_CTLOG_STORE_LOAD_CTX_NEW, ERR_R_MALLOC_FAILURE);
                ^
  63.   
  64.       return ctx;

crypto/ct/ct_log.c:64:5: 
  62.           CTerr(CT_F_CTLOG_STORE_LOAD_CTX_NEW, ERR_R_MALLOC_FAILURE);
  63.   
  64. >     return ctx;
  65.   }
  66.   

crypto/ct/ct_log.c:65:1: return from a call to ctlog_store_load_ctx_new
  63.   
  64.       return ctx;
  65. > }
  66.   
  67.   static void ctlog_store_load_ctx_free(CTLOG_STORE_LOAD_CTX* ctx)

crypto/ct/ct_log.c:201:5: 
199.       CTLOG_STORE_LOAD_CTX* load_ctx = ctlog_store_load_ctx_new();
200.   
201. >     load_ctx->log_store = store;
202.       load_ctx->conf = NCONF_new(NULL);
203.       if (load_ctx->conf == NULL)
