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


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

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

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

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

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

crypto/mem.c:253:1: parameter `str` of CRYPTO_free
      251.   }
      252.   
      253. > void CRYPTO_free(void *str, const char *file, int line)
      254.   {
      255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:269:5: was invalidated by call to `free()`
      267.       }
      268.   #else
      269.       free(str);
                 ^
      270.   #endif
      271.   }

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

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

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

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

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

crypto/mem.c:253:1: parameter `str` of CRYPTO_free
      251.   }
      252.   
      253. > void CRYPTO_free(void *str, const char *file, int line)
      254.   {
      255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:269:5: invalid access occurs here
      267.       }
      268.   #else
      269.       free(str);
                 ^
      270.   #endif
      271.   }
