apps/s_client.c:517: error: USE_AFTER_FREE
  call to `tlsa_import_rr()` eventually accesses memory that was invalidated by call to `free()` on line 517 indirectly during the call to `tlsa_import_rr()`.
Showing all 14 steps of the trace


apps/s_client.c:517:13: invalidation part of the trace starts here
515.       for (i = 0; i < num; ++i) {
516.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
517.           if (tlsa_import_rr(con, rrdata) > 0)
                   ^
518.               ++count;
519.       }

apps/s_client.c:517:13: global variable `tlsa_import_rr.data` accessed here
  515.       for (i = 0; i < num; ++i) {
  516.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  517.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  518.               ++count;
  519.       }

apps/s_client.c:517:13: when calling `tlsa_import_rr` here
  515.       for (i = 0; i < num; ++i) {
  516.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  517.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  518.               ++count;
  519.       }

apps/s_client.c:474:9: global variable `tlsa_import_rr.data` accessed here
    472.           { &selector, "selector", checked_uint8 },
    473.           { &mtype, "mtype", checked_uint8 },
    474.           { &data, "data", hexdecode },
                   ^
    475.           { NULL, }
    476.       };

apps/s_client.c:492:5: when calling `CRYPTO_free` here
    490.       /* The data field is last, so len is its length */
    491.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    492.       OPENSSL_free(data);
               ^
    493.   
    494.       if (ret == 0) {

crypto/mem.c:163:1: parameter `str` of CRYPTO_free
      161.   }
      162.   
      163. > void CRYPTO_free(void *str, const char *file, int line)
      164.   {
      165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:179:5: was invalidated by call to `free()`
      177.       }
      178.   #else
      179.       free(str);
                 ^
      180.   #endif
      181.   }

apps/s_client.c:517:13: use-after-lifetime part of the trace starts here
515.       for (i = 0; i < num; ++i) {
516.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
517.           if (tlsa_import_rr(con, rrdata) > 0)
                   ^
518.               ++count;
519.       }

apps/s_client.c:517:13: global variable `tlsa_import_rr.data` accessed here
  515.       for (i = 0; i < num; ++i) {
  516.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  517.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  518.               ++count;
  519.       }

apps/s_client.c:517:13: when calling `tlsa_import_rr` here
  515.       for (i = 0; i < num; ++i) {
  516.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  517.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  518.               ++count;
  519.       }

apps/s_client.c:474:9: global variable `tlsa_import_rr.data` accessed here
    472.           { &selector, "selector", checked_uint8 },
    473.           { &mtype, "mtype", checked_uint8 },
    474.           { &data, "data", hexdecode },
                   ^
    475.           { NULL, }
    476.       };

apps/s_client.c:492:5: when calling `CRYPTO_free` here
    490.       /* The data field is last, so len is its length */
    491.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    492.       OPENSSL_free(data);
               ^
    493.   
    494.       if (ret == 0) {

crypto/mem.c:163:1: parameter `str` of CRYPTO_free
      161.   }
      162.   
      163. > void CRYPTO_free(void *str, const char *file, int line)
      164.   {
      165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:179:5: invalid access occurs here
      177.       }
      178.   #else
      179.       free(str);
                 ^
      180.   #endif
      181.   }
