test/ssl_test_ctx.c:891: error: NULL_DEREFERENCE
  pointer `ctx` last assigned on line 835 could be null and is dereferenced by call to `SSL_TEST_CTX_free()` at line 891, column 5.
Showing all 40 steps of the trace


test/ssl_test_ctx.c:832:1: start of procedure SSL_TEST_CTX_create()
830.   }
831.   
832. > SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
833.   {
834.       STACK_OF(CONF_VALUE) *sk_conf = NULL;

test/ssl_test_ctx.c:834:5: 
832.   SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
833.   {
834. >     STACK_OF(CONF_VALUE) *sk_conf = NULL;
835.       SSL_TEST_CTX *ctx = NULL;
836.       int i;

test/ssl_test_ctx.c:835:5: 
833.   {
834.       STACK_OF(CONF_VALUE) *sk_conf = NULL;
835. >     SSL_TEST_CTX *ctx = NULL;
836.       int i;
837.       size_t j;

test/ssl_test_ctx.c:839:10: 
837.       size_t j;
838.   
839. >     if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
840.               || !TEST_ptr(ctx = SSL_TEST_CTX_new()))
841.           goto err;

crypto/conf/conf_lib.c:242:1: start of procedure NCONF_get_section()
  240.   }
  241.   
  242. > STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section)
  243.   {
  244.       if (conf == NULL) {

crypto/conf/conf_lib.c:244:9: Taking false branch
  242.   STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section)
  243.   {
  244.       if (conf == NULL) {
                 ^
  245.           CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_CONF);
  246.           return NULL;

crypto/conf/conf_lib.c:249:9: Taking false branch
  247.       }
  248.   
  249.       if (section == NULL) {
                 ^
  250.           CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_SECTION);
  251.           return NULL;

crypto/conf/conf_lib.c:254:5: 
  252.       }
  253.   
  254. >     return _CONF_get_section_values(conf, section);
  255.   }
  256.   

crypto/conf/conf_api.c:36:1: start of procedure _CONF_get_section_values()
    34.   
    35.   /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
    36. > STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
    37.                                                  const char *section)
    38.   {

crypto/conf/conf_api.c:41:5: 
    39.       CONF_VALUE *v;
    40.   
    41. >     v = _CONF_get_section(conf, section);
    42.       if (v != NULL)
    43.           return ((STACK_OF(CONF_VALUE) *)v->value);

crypto/conf/conf_api.c:23:1: start of procedure _CONF_get_section()
      21.   
      22.   /* Up until OpenSSL 0.9.5a, this was get_section */
      23. > CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)
      24.   {
      25.       CONF_VALUE *v, vv;

crypto/conf/conf_api.c:27:10: Taking false branch
      25.       CONF_VALUE *v, vv;
      26.   
      27.       if ((conf == NULL) || (section == NULL))
                     ^
      28.           return NULL;
      29.       vv.name = NULL;

crypto/conf/conf_api.c:27:28: Taking false branch
      25.       CONF_VALUE *v, vv;
      26.   
      27.       if ((conf == NULL) || (section == NULL))
                                       ^
      28.           return NULL;
      29.       vv.name = NULL;

crypto/conf/conf_api.c:29:5: 
      27.       if ((conf == NULL) || (section == NULL))
      28.           return NULL;
      29. >     vv.name = NULL;
      30.       vv.section = (char *)section;
      31.       v = lh_CONF_VALUE_retrieve(conf->data, &vv);

crypto/conf/conf_api.c:30:5: 
      28.           return NULL;
      29.       vv.name = NULL;
      30. >     vv.section = (char *)section;
      31.       v = lh_CONF_VALUE_retrieve(conf->data, &vv);
      32.       return v;

crypto/conf/conf_api.c:31:5: 
      29.       vv.name = NULL;
      30.       vv.section = (char *)section;
      31. >     v = lh_CONF_VALUE_retrieve(conf->data, &vv);
      32.       return v;
      33.   }

include/openssl/conf.h:31:1: start of procedure lh_CONF_VALUE_retrieve()
        29.   
        30.   DEFINE_STACK_OF(CONF_VALUE)
        31. > DEFINE_LHASH_OF(CONF_VALUE);
        32.   
        33.   struct conf_st;

crypto/lhash/lhash.c:165:1: start of procedure OPENSSL_LH_retrieve()
          163.   }
          164.   
          165. > void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data)
          166.   {
          167.       unsigned long hash;

crypto/lhash/lhash.c:171:5: 
          169.       void *ret;
          170.   
          171. >     tsan_store((TSAN_QUALIFIER int *)&lh->error, 0);
          172.   
          173.       rn = getrn(lh, data, &hash);

crypto/lhash/lhash.c:173:5: Skipping getrn(): empty list of specs
          171.       tsan_store((TSAN_QUALIFIER int *)&lh->error, 0);
          172.   
          173.       rn = getrn(lh, data, &hash);
                     ^
          174.   
          175.       if (*rn == NULL) {

crypto/lhash/lhash.c:175:9: Taking false branch
          173.       rn = getrn(lh, data, &hash);
          174.   
          175.       if (*rn == NULL) {
                         ^
          176.           tsan_counter(&lh->num_retrieve_miss);
          177.           return NULL;

crypto/lhash/lhash.c:179:9: 
          177.           return NULL;
          178.       } else {
          179. >         ret = (*rn)->data;
          180.           tsan_counter(&lh->num_retrieve);
          181.       }

crypto/lhash/lhash.c:180:9: 
          178.       } else {
          179.           ret = (*rn)->data;
          180. >         tsan_counter(&lh->num_retrieve);
          181.       }
          182.   

crypto/lhash/lhash.c:183:5: 
          181.       }
          182.   
          183. >     return ret;
          184.   }
          185.   

crypto/lhash/lhash.c:184:1: return from a call to OPENSSL_LH_retrieve
          182.   
          183.       return ret;
          184. > }
          185.   
          186.   static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,

include/openssl/conf.h:31:1: return from a call to lh_CONF_VALUE_retrieve
        29.   
        30.   DEFINE_STACK_OF(CONF_VALUE)
        31. > DEFINE_LHASH_OF(CONF_VALUE);
        32.   
        33.   struct conf_st;

crypto/conf/conf_api.c:32:5: 
      30.       vv.section = (char *)section;
      31.       v = lh_CONF_VALUE_retrieve(conf->data, &vv);
      32. >     return v;
      33.   }
      34.   

crypto/conf/conf_api.c:33:1: return from a call to _CONF_get_section
      31.       v = lh_CONF_VALUE_retrieve(conf->data, &vv);
      32.       return v;
      33. > }
      34.   
      35.   /* Up until OpenSSL 0.9.5a, this was CONF_get_section */

crypto/conf/conf_api.c:42:9: Taking true branch
    40.   
    41.       v = _CONF_get_section(conf, section);
    42.       if (v != NULL)
                  ^
    43.           return ((STACK_OF(CONF_VALUE) *)v->value);
    44.       else

crypto/conf/conf_api.c:43:9: 
    41.       v = _CONF_get_section(conf, section);
    42.       if (v != NULL)
    43. >         return ((STACK_OF(CONF_VALUE) *)v->value);
    44.       else
    45.           return NULL;

crypto/conf/conf_api.c:46:1: return from a call to _CONF_get_section_values
    44.       else
    45.           return NULL;
    46. > }
    47.   
    48.   int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)

crypto/conf/conf_lib.c:255:1: return from a call to NCONF_get_section
  253.   
  254.       return _CONF_get_section_values(conf, section);
  255. > }
  256.   
  257.   char *NCONF_get_string(const CONF *conf, const char *group, const char *name)

test/testutil/tests.c:252:1: start of procedure test_ptr()
  250.   }
  251.   
  252. > int test_ptr(const char *file, int line, const char *s, const void *p)
  253.   {
  254.       if (p != NULL)

test/testutil/tests.c:254:9: Taking false branch
  252.   int test_ptr(const char *file, int line, const char *s, const void *p)
  253.   {
  254.       if (p != NULL)
                 ^
  255.           return 1;
  256.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:256:5: Skipping test_fail_message(): empty list of specs
  254.       if (p != NULL)
  255.           return 1;
  256.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
             ^
  257.       return 0;
  258.   }

test/testutil/tests.c:257:5: 
  255.           return 1;
  256.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  257. >     return 0;
  258.   }
  259.   

test/testutil/tests.c:258:1: return from a call to test_ptr
  256.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  257.       return 0;
  258. > }
  259.   
  260.   int test_true(const char *file, int line, const char *s, int b)

test/ssl_test_ctx.c:839:10: Taking true branch
837.       size_t j;
838.   
839.       if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
                ^
840.               || !TEST_ptr(ctx = SSL_TEST_CTX_new()))
841.           goto err;

test/ssl_test_ctx.c:890:2: 
888.       goto done;
889.   
890. >  err:
891.       SSL_TEST_CTX_free(ctx);
892.       ctx = NULL;

test/ssl_test_ctx.c:891:5: 
889.   
890.    err:
891. >     SSL_TEST_CTX_free(ctx);
892.       ctx = NULL;
893.    done:
