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


apps/s_client.c:557:13: invalidation part of the trace starts here
555.       for (i = 0; i < num; ++i) {
556.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
557.           if (tlsa_import_rr(con, rrdata) > 0)
                   ^
558.               ++count;
559.       }

apps/s_client.c:557:13: global variable `tlsa_import_rr.data` accessed here
  555.       for (i = 0; i < num; ++i) {
  556.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  557.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  558.               ++count;
  559.       }

apps/s_client.c:557:13: when calling `tlsa_import_rr` here
  555.       for (i = 0; i < num; ++i) {
  556.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  557.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  558.               ++count;
  559.       }

apps/s_client.c:514:9: global variable `tlsa_import_rr.data` accessed here
    512.           { &selector, "selector", checked_uint8 },
    513.           { &mtype, "mtype", checked_uint8 },
    514.           { &data, "data", hexdecode },
                   ^
    515.           { NULL, }
    516.       };

apps/s_client.c:532:5: when calling `CRYPTO_free` here
    530.       /* The data field is last, so len is its length */
    531.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    532.       OPENSSL_free(data);
               ^
    533.   
    534.       if (ret == 0) {

crypto/mem.c:295:1: parameter `str` of CRYPTO_free
      293.   }
      294.   
      295. > void CRYPTO_free(void *str, const char *file, int line)
      296.   {
      297.       INCREMENT(free_count);

crypto/mem.c:312:5: was invalidated by call to `free()`
      310.       }
      311.   #else
      312.       free(str);
                 ^
      313.   #endif
      314.   }

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

apps/s_client.c:557:13: global variable `tlsa_import_rr.data` accessed here
  555.       for (i = 0; i < num; ++i) {
  556.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  557.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  558.               ++count;
  559.       }

apps/s_client.c:557:13: when calling `tlsa_import_rr` here
  555.       for (i = 0; i < num; ++i) {
  556.           char *rrdata = sk_OPENSSL_STRING_value(rrset, i);
  557.           if (tlsa_import_rr(con, rrdata) > 0)
                     ^
  558.               ++count;
  559.       }

apps/s_client.c:514:9: global variable `tlsa_import_rr.data` accessed here
    512.           { &selector, "selector", checked_uint8 },
    513.           { &mtype, "mtype", checked_uint8 },
    514.           { &data, "data", hexdecode },
                   ^
    515.           { NULL, }
    516.       };

apps/s_client.c:532:5: when calling `CRYPTO_free` here
    530.       /* The data field is last, so len is its length */
    531.       ret = SSL_dane_tlsa_add(con, usage, selector, mtype, data, len);
    532.       OPENSSL_free(data);
               ^
    533.   
    534.       if (ret == 0) {

crypto/mem.c:295:1: parameter `str` of CRYPTO_free
      293.   }
      294.   
      295. > void CRYPTO_free(void *str, const char *file, int line)
      296.   {
      297.       INCREMENT(free_count);

crypto/mem.c:312:5: invalid access occurs here
      310.       }
      311.   #else
      312.       free(str);
                 ^
      313.   #endif
      314.   }
