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


apps/s_client.c:525:13: invalidation part of the trace starts here
523.       for (i = 0; i < num; ++i) {
524.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
525.           if (tlsa_import_rr(con, rrdata) > 0)
                   ^
526.               ++count;
527.       }

apps/s_client.c:525:13: global variable `tlsa_import_rr.data` accessed here
  523.       for (i = 0; i < num; ++i) {
  524.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  525.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  526.               ++count;
  527.       }

apps/s_client.c:525:13: when calling `tlsa_import_rr` here
  523.       for (i = 0; i < num; ++i) {
  524.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  525.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  526.               ++count;
  527.       }

apps/s_client.c:482:9: global variable `tlsa_import_rr.data` accessed here
    480.           { &selector, "selector", checked_uint8 },
    481.           { &mtype, "mtype", checked_uint8 },
    482.           { &data, "data", hexdecode },
                   ^
    483.           { NULL, }
    484.       };

apps/s_client.c:500:5: when calling `CRYPTO_free` here
    498.       /* The data field is last, so len is its length */
    499.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    500.       OPENSSL_free(data);
               ^
    501.   
    502.       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:525:13: use-after-lifetime part of the trace starts here
523.       for (i = 0; i < num; ++i) {
524.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
525.           if (tlsa_import_rr(con, rrdata) > 0)
                   ^
526.               ++count;
527.       }

apps/s_client.c:525:13: global variable `tlsa_import_rr.data` accessed here
  523.       for (i = 0; i < num; ++i) {
  524.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  525.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  526.               ++count;
  527.       }

apps/s_client.c:525:13: when calling `tlsa_import_rr` here
  523.       for (i = 0; i < num; ++i) {
  524.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  525.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  526.               ++count;
  527.       }

apps/s_client.c:482:9: global variable `tlsa_import_rr.data` accessed here
    480.           { &selector, "selector", checked_uint8 },
    481.           { &mtype, "mtype", checked_uint8 },
    482.           { &data, "data", hexdecode },
                   ^
    483.           { NULL, }
    484.       };

apps/s_client.c:500:5: when calling `CRYPTO_free` here
    498.       /* The data field is last, so len is its length */
    499.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    500.       OPENSSL_free(data);
               ^
    501.   
    502.       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.   }
