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


ssl/ssl_lib.c:363:1: start of procedure dane_tlsa_add()
361.   }
362.   
363. > static int dane_tlsa_add(
364.       SSL_DANE *dane,
365.       uint8_t usage,

ssl/ssl_lib.c:372:5: 
370.   {
371.       danetls_record *t;
372. >     const EVP_MD *md = NULL;
373.       int ilen = (int)dlen;
374.       int i;

ssl/ssl_lib.c:373:5: 
371.       danetls_record *t;
372.       const EVP_MD *md = NULL;
373. >     int ilen = (int)dlen;
374.       int i;
375.       int num;

ssl/ssl_lib.c:377:9: Taking false branch
375.       int num;
376.   
377.       if (dane->trecs == NULL) {
               ^
378.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_NOT_ENABLED);
379.           return -1;

ssl/ssl_lib.c:382:9: Taking false branch
380.       }
381.   
382.       if (ilen < 0 || dlen != (size_t)ilen) {
               ^
383.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DATA_LENGTH);
384.           return 0;

ssl/ssl_lib.c:382:21: Taking false branch
380.       }
381.   
382.       if (ilen < 0 || dlen != (size_t)ilen) {
                           ^
383.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DATA_LENGTH);
384.           return 0;

ssl/ssl_lib.c:387:9: Taking false branch
385.       }
386.   
387.       if (usage > DANETLS_USAGE_LAST) {
               ^
388.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE);
389.           return 0;

ssl/ssl_lib.c:392:9: Taking false branch
390.       }
391.   
392.       if (selector > DANETLS_SELECTOR_LAST) {
               ^
393.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_SELECTOR);
394.           return 0;

ssl/ssl_lib.c:397:9: Taking true branch
395.       }
396.   
397.       if (mtype != DANETLS_MATCHING_FULL) {
               ^
398.           md = tlsa_md_get(dane, mtype);
399.           if (md == NULL) {

ssl/ssl_lib.c:398:9: 
396.   
397.       if (mtype != DANETLS_MATCHING_FULL) {
398. >         md = tlsa_md_get(dane, mtype);
399.           if (md == NULL) {
400.               SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE);

ssl/ssl_lib.c:356:1: start of procedure tlsa_md_get()
  354.   }
  355.   
  356. > static const EVP_MD *tlsa_md_get(SSL_DANE *dane, uint8_t mtype)
  357.   {
  358.       if (mtype > dane->dctx->mdmax)

ssl/ssl_lib.c:358:9: Taking false branch
  356.   static const EVP_MD *tlsa_md_get(SSL_DANE *dane, uint8_t mtype)
  357.   {
  358.       if (mtype > dane->dctx->mdmax)
                 ^
  359.           return NULL;
  360.       return dane->dctx->mdevp[mtype];

ssl/ssl_lib.c:360:5: 
  358.       if (mtype > dane->dctx->mdmax)
  359.           return NULL;
  360. >     return dane->dctx->mdevp[mtype];
  361.   }
  362.   

ssl/ssl_lib.c:361:1: return from a call to tlsa_md_get
  359.           return NULL;
  360.       return dane->dctx->mdevp[mtype];
  361. > }
  362.   
  363.   static int dane_tlsa_add(

ssl/ssl_lib.c:399:13: Taking false branch
397.       if (mtype != DANETLS_MATCHING_FULL) {
398.           md = tlsa_md_get(dane, mtype);
399.           if (md == NULL) {
                   ^
400.               SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE);
401.               return 0;

ssl/ssl_lib.c:405:9: Taking true branch
403.       }
404.   
405.       if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
               ^
406.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
407.           return 0;

ssl/ssl_lib.c:405:23: 
403.       }
404.   
405. >     if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
406.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
407.           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:405:23: Taking false branch
403.       }
404.   
405.       if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
                             ^
406.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
407.           return 0;

ssl/ssl_lib.c:409:10: Taking false branch
407.           return 0;
408.       }
409.       if (!data) {
                ^
410.           SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_NULL_DATA);
411.           return 0;

ssl/ssl_lib.c:414:9: 
412.       }
413.   
414. >     if ((t = OPENSSL_zalloc(sizeof(*t))) == NULL) {
415.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
416.           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:414:9: Taking false branch
412.       }
413.   
414.       if ((t = OPENSSL_zalloc(sizeof(*t))) == NULL) {
               ^
415.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
416.           return -1;

ssl/ssl_lib.c:419:5: 
417.       }
418.   
419. >     t->usage = usage;
420.       t->selector = selector;
421.       t->mtype = mtype;

ssl/ssl_lib.c:420:5: 
418.   
419.       t->usage = usage;
420. >     t->selector = selector;
421.       t->mtype = mtype;
422.       t->data = OPENSSL_malloc(ilen);

ssl/ssl_lib.c:421:5: 
419.       t->usage = usage;
420.       t->selector = selector;
421. >     t->mtype = mtype;
422.       t->data = OPENSSL_malloc(ilen);
423.       if (t->data == NULL) {

ssl/ssl_lib.c:422:5: 
420.       t->selector = selector;
421.       t->mtype = mtype;
422. >     t->data = OPENSSL_malloc(ilen);
423.       if (t->data == NULL) {
424.           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:423:9: Taking true branch
421.       t->mtype = mtype;
422.       t->data = OPENSSL_malloc(ilen);
423.       if (t->data == NULL) {
               ^
424.           tlsa_free(t);
425.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);

ssl/ssl_lib.c:424:9: Skipping tlsa_free(): empty list of specs
422.       t->data = OPENSSL_malloc(ilen);
423.       if (t->data == NULL) {
424.           tlsa_free(t);
               ^
425.           SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
426.           return -1;
