ssl/ssl_lib.c:414: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_zalloc()` at line 404, column 14 is not reachable after line 414, column 9.
Showing all 53 steps of the trace


ssl/ssl_lib.c:354:1: start of procedure dane_tlsa_add()
352.   }
353.   
354. > static int dane_tlsa_add(
355.       SSL_DANE *dane,
356.       uint8_t usage,

ssl/ssl_lib.c:363:5: 
361.   {
362.       danetls_record *t;
363. >     const EVP_MD *md = NULL;
364.       int ilen = (int)dlen;
365.       int i;

ssl/ssl_lib.c:364:5: 
362.       danetls_record *t;
363.       const EVP_MD *md = NULL;
364. >     int ilen = (int)dlen;
365.       int i;
366.   

ssl/ssl_lib.c:367:9: Taking false branch
365.       int i;
366.   
367.       if (dane->trecs == NULL) {
               ^
368.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_NOT_ENABLED);
369.           return -1;

ssl/ssl_lib.c:372:9: Taking false branch
370.       }
371.   
372.       if (ilen < 0 || dlen != (size_t)ilen) {
               ^
373.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DATA_LENGTH);
374.           return 0;

ssl/ssl_lib.c:372:21: Taking false branch
370.       }
371.   
372.       if (ilen < 0 || dlen != (size_t)ilen) {
                           ^
373.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DATA_LENGTH);
374.           return 0;

ssl/ssl_lib.c:377:9: Taking false branch
375.       }
376.   
377.       if (usage > DANETLS_USAGE_LAST) {
               ^
378.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE);
379.           return 0;

ssl/ssl_lib.c:382:9: Taking false branch
380.       }
381.   
382.       if (selector > DANETLS_SELECTOR_LAST) {
               ^
383.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_SELECTOR);
384.           return 0;

ssl/ssl_lib.c:387:9: Taking true branch
385.       }
386.   
387.       if (mtype != DANETLS_MATCHING_FULL) {
               ^
388.           md = tlsa_md_get(dane, mtype);
389.           if (md == NULL) {

ssl/ssl_lib.c:388:9: 
386.   
387.       if (mtype != DANETLS_MATCHING_FULL) {
388. >         md = tlsa_md_get(dane, mtype);
389.           if (md == NULL) {
390.               SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE);

ssl/ssl_lib.c:347:1: start of procedure tlsa_md_get()
  345.   }
  346.   
  347. > static const EVP_MD *tlsa_md_get(SSL_DANE *dane, uint8_t mtype)
  348.   {
  349.       if (mtype > dane->dctx->mdmax)

ssl/ssl_lib.c:349:9: Taking false branch
  347.   static const EVP_MD *tlsa_md_get(SSL_DANE *dane, uint8_t mtype)
  348.   {
  349.       if (mtype > dane->dctx->mdmax)
                 ^
  350.           return NULL;
  351.       return dane->dctx->mdevp[mtype];

ssl/ssl_lib.c:351:5: 
  349.       if (mtype > dane->dctx->mdmax)
  350.           return NULL;
  351. >     return dane->dctx->mdevp[mtype];
  352.   }
  353.   

ssl/ssl_lib.c:352:1: return from a call to tlsa_md_get
  350.           return NULL;
  351.       return dane->dctx->mdevp[mtype];
  352. > }
  353.   
  354.   static int dane_tlsa_add(

ssl/ssl_lib.c:389:13: Taking false branch
387.       if (mtype != DANETLS_MATCHING_FULL) {
388.           md = tlsa_md_get(dane, mtype);
389.           if (md == NULL) {
                   ^
390.               SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE);
391.               return 0;

ssl/ssl_lib.c:395:9: Taking true branch
393.       }
394.   
395.       if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
               ^
396.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
397.           return 0;

ssl/ssl_lib.c:395:23: 
393.       }
394.   
395. >     if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
396.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
397.           return 0;

crypto/evp/evp_lib.c:349:1: start of procedure EVP_MD_size()
  347.   }
  348.   
  349. > int EVP_MD_size(const EVP_MD *md)
  350.   {
  351.       if (!md) {

crypto/evp/evp_lib.c:351:10: Taking false branch
  349.   int EVP_MD_size(const EVP_MD *md)
  350.   {
  351.       if (!md) {
                  ^
  352.           EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
  353.           return -1;

crypto/evp/evp_lib.c:355:5: 
  353.           return -1;
  354.       }
  355. >     return md->md_size;
  356.   }
  357.   

crypto/evp/evp_lib.c:356:1: return from a call to EVP_MD_size
  354.       }
  355.       return md->md_size;
  356. > }
  357.   
  358.   unsigned long EVP_MD_flags(const EVP_MD *md)

ssl/ssl_lib.c:395:23: Taking false branch
393.       }
394.   
395.       if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
                             ^
396.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
397.           return 0;

ssl/ssl_lib.c:399:10: Taking false branch
397.           return 0;
398.       }
399.       if (!data) {
                ^
400.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_NULL_DATA);
401.           return 0;

ssl/ssl_lib.c:404:9: 
402.       }
403.   
404. >     if ((t = OPENSSL_zalloc(sizeof(*t))) == NULL) {
405.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
406.           return -1;

crypto/mem.c:146:1: start of procedure CRYPTO_zalloc()
  144.   }
  145.   
  146. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  147.   {
  148.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:148:5: 
  146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  147.   {
  148. >     void *ret = CRYPTO_malloc(num, file, line);
  149.   
  150.       if (ret != NULL)

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
    117.   }
    118.   
    119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121.       void *ret = NULL;

crypto/mem.c:121:5: 
    119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121. >     void *ret = NULL;
    122.   
    123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    124.           return malloc_impl(num, file, line);
    125.   

crypto/mem.c:126:9: Taking false branch
    124.           return malloc_impl(num, file, line);
    125.   
    126.       if (num <= 0)
                   ^
    127.           return NULL;
    128.   

crypto/mem.c:129:5: 
    127.           return NULL;
    128.   
    129. >     allow_customize = 0;
    130.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    131.       if (call_malloc_debug) {

crypto/mem.c:139:5: 
    137.       }
    138.   #else
    139. >     osslargused(file); osslargused(line);
    140.       ret = malloc(num);
    141.   #endif

crypto/mem.c:139:24: 
    137.       }
    138.   #else
    139. >     osslargused(file); osslargused(line);
    140.       ret = malloc(num);
    141.   #endif

crypto/mem.c:140:5: 
    138.   #else
    139.       osslargused(file); osslargused(line);
    140. >     ret = malloc(num);
    141.   #endif
    142.   

crypto/mem.c:143:5: 
    141.   #endif
    142.   
    143. >     return ret;
    144.   }
    145.   

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
    142.   
    143.       return ret;
    144. > }
    145.   
    146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:150:9: Taking true branch
  148.       void *ret = CRYPTO_malloc(num, file, line);
  149.   
  150.       if (ret != NULL)
                 ^
  151.           memset(ret, 0, num);
  152.       return ret;

crypto/mem.c:151:9: 
  149.   
  150.       if (ret != NULL)
  151. >         memset(ret, 0, num);
  152.       return ret;
  153.   }

crypto/mem.c:152:5: 
  150.       if (ret != NULL)
  151.           memset(ret, 0, num);
  152. >     return ret;
  153.   }
  154.   

crypto/mem.c:153:1: return from a call to CRYPTO_zalloc
  151.           memset(ret, 0, num);
  152.       return ret;
  153. > }
  154.   
  155.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

ssl/ssl_lib.c:404:9: Taking false branch
402.       }
403.   
404.       if ((t = OPENSSL_zalloc(sizeof(*t))) == NULL) {
               ^
405.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
406.           return -1;

ssl/ssl_lib.c:409:5: 
407.       }
408.   
409. >     t->usage = usage;
410.       t->selector = selector;
411.       t->mtype = mtype;

ssl/ssl_lib.c:410:5: 
408.   
409.       t->usage = usage;
410. >     t->selector = selector;
411.       t->mtype = mtype;
412.       t->data = OPENSSL_malloc(ilen);

ssl/ssl_lib.c:411:5: 
409.       t->usage = usage;
410.       t->selector = selector;
411. >     t->mtype = mtype;
412.       t->data = OPENSSL_malloc(ilen);
413.       if (t->data == NULL) {

ssl/ssl_lib.c:412:5: 
410.       t->selector = selector;
411.       t->mtype = mtype;
412. >     t->data = OPENSSL_malloc(ilen);
413.       if (t->data == NULL) {
414.           tlsa_free(t);

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
  117.   }
  118.   
  119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  120.   {
  121.       void *ret = NULL;

crypto/mem.c:121:5: 
  119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  120.   {
  121. >     void *ret = NULL;
  122.   
  123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking true branch
  121.       void *ret = NULL;
  122.   
  123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  124.           return malloc_impl(num, file, line);
  125.   

crypto/mem.c:123:32: Taking true branch
  121.       void *ret = NULL;
  122.   
  123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                        ^
  124.           return malloc_impl(num, file, line);
  125.   

crypto/mem.c:124:9: Skipping __function_pointer__(): unresolved function pointer
  122.   
  123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
  124.           return malloc_impl(num, file, line);
                 ^
  125.   
  126.       if (num <= 0)

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
  142.   
  143.       return ret;
  144. > }
  145.   
  146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

ssl/ssl_lib.c:413:9: Taking true branch
411.       t->mtype = mtype;
412.       t->data = OPENSSL_malloc(ilen);
413.       if (t->data == NULL) {
               ^
414.           tlsa_free(t);
415.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);

ssl/ssl_lib.c:414:9: Skipping tlsa_free(): empty list of specs
412.       t->data = OPENSSL_malloc(ilen);
413.       if (t->data == NULL) {
414.           tlsa_free(t);
               ^
415.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
416.           return -1;
