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


test/ssl_test_ctx.c:809:1: start of procedure SSL_TEST_CTX_create()
807.   }
808.   
809. > SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
810.   {
811.       STACK_OF(CONF_VALUE) *sk_conf = NULL;

test/ssl_test_ctx.c:811:5: 
809.   SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
810.   {
811. >     STACK_OF(CONF_VALUE) *sk_conf = NULL;
812.       SSL_TEST_CTX *ctx = NULL;
813.       int i;

test/ssl_test_ctx.c:812:5: 
810.   {
811.       STACK_OF(CONF_VALUE) *sk_conf = NULL;
812. >     SSL_TEST_CTX *ctx = NULL;
813.       int i;
814.       size_t j;

test/ssl_test_ctx.c:816:10: 
814.       size_t j;
815.   
816. >     if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
817.               || !TEST_ptr(ctx = SSL_TEST_CTX_new()))
818.           goto err;

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

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

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

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

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

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

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

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

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

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

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

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

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:147:1: start of procedure OPENSSL_LH_retrieve()
          145.   }
          146.   
          147. > void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data)
          148.   {
          149.       unsigned long hash;

crypto/lhash/lhash.c:153:5: 
          151.       void *ret;
          152.   
          153. >     lh->error = 0;
          154.       rn = getrn(lh, data, &hash);
          155.   

crypto/lhash/lhash.c:154:5: Skipping getrn(): empty list of specs
          152.   
          153.       lh->error = 0;
          154.       rn = getrn(lh, data, &hash);
                     ^
          155.   
          156.       if (*rn == NULL) {

crypto/lhash/lhash.c:156:9: Taking true branch
          154.       rn = getrn(lh, data, &hash);
          155.   
          156.       if (*rn == NULL) {
                         ^
          157.           lh->num_retrieve_miss++;
          158.           return NULL;

crypto/lhash/lhash.c:157:9: 
          155.   
          156.       if (*rn == NULL) {
          157. >         lh->num_retrieve_miss++;
          158.           return NULL;
          159.       } else {

crypto/lhash/lhash.c:158:9: 
          156.       if (*rn == NULL) {
          157.           lh->num_retrieve_miss++;
          158. >         return NULL;
          159.       } else {
          160.           ret = (*rn)->data;

crypto/lhash/lhash.c:164:1: return from a call to OPENSSL_LH_retrieve
          162.       }
          163.       return ret;
          164. > }
          165.   
          166.   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:31:5: 
      29.       vv.section = (char *)section;
      30.       v = lh_CONF_VALUE_retrieve(conf->data, &vv);
      31. >     return v;
      32.   }
      33.   

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

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

crypto/conf/conf_api.c:44:9: 
    42.           return ((STACK_OF(CONF_VALUE) *)v->value);
    43.       else
    44. >         return NULL;
    45.   }
    46.   

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

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

test/testutil/tests.c:228:1: start of procedure test_ptr()
  226.   }
  227.   
  228. > int test_ptr(const char *file, int line, const char *s, const void *p)
  229.   {
  230.       if (p != NULL)

test/testutil/tests.c:230:9: Taking false branch
  228.   int test_ptr(const char *file, int line, const char *s, const void *p)
  229.   {
  230.       if (p != NULL)
                 ^
  231.           return 1;
  232.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:232:5: Skipping test_fail_message(): empty list of specs
  230.       if (p != NULL)
  231.           return 1;
  232.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
             ^
  233.       return 0;
  234.   }

test/testutil/tests.c:233:5: 
  231.           return 1;
  232.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  233. >     return 0;
  234.   }
  235.   

test/testutil/tests.c:234:1: return from a call to test_ptr
  232.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  233.       return 0;
  234. > }
  235.   
  236.   int test_true(const char *file, int line, const char *s, int b)

test/ssl_test_ctx.c:816:10: Taking true branch
814.       size_t j;
815.   
816.       if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
                ^
817.               || !TEST_ptr(ctx = SSL_TEST_CTX_new()))
818.           goto err;

test/ssl_test_ctx.c:867:2: 
865.       goto done;
866.   
867. >  err:
868.       SSL_TEST_CTX_free(ctx);
869.       ctx = NULL;

test/ssl_test_ctx.c:868:5: 
866.   
867.    err:
868. >     SSL_TEST_CTX_free(ctx);
869.       ctx = NULL;
870.    done:
