crypto/asn1/a_digest.c:90: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `CRYPTO_malloc()` at line 82, column 16 is not reachable after line 90, column 9.
Showing all 40 steps of the trace


crypto/asn1/a_digest.c:75:1: start of procedure ASN1_digest()
73.   #ifndef NO_ASN1_OLD
74.   
75. > int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
76.                   unsigned char *md, unsigned int *len)
77.   {

crypto/asn1/a_digest.c:81:5: Skipping __function_pointer__(): unresolved function pointer
79.       unsigned char *str, *p;
80.   
81.       i = i2d(data, NULL);
          ^
82.       if ((str = OPENSSL_malloc(i)) == NULL) {
83.           ASN1err(ASN1_F_ASN1_DIGEST, ERR_R_MALLOC_FAILURE);

crypto/asn1/a_digest.c:82:9: 
80.   
81.       i = i2d(data, NULL);
82. >     if ((str = OPENSSL_malloc(i)) == NULL) {
83.           ASN1err(ASN1_F_ASN1_DIGEST, ERR_R_MALLOC_FAILURE);
84.           return (0);

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

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

crypto/mem.c:124:9: Taking false branch
  122.       void *ret = NULL;
  123.   
  124.       if (num <= 0)
                 ^
  125.           return NULL;
  126.   

crypto/mem.c:127:5: 
  125.           return NULL;
  126.   
  127. >     allow_customize = 0;
  128.   #ifdef CRYPTO_MDEBUG
  129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
  135.       }
  136.   #else
  137. >     (void)file;
  138.       (void)line;
  139.       ret = malloc(num);

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

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

crypto/mem.c:154:5: 
  152.   #endif
  153.   
  154. >     return ret;
  155.   }
  156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
  153.   
  154.       return ret;
  155. > }
  156.   
  157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/asn1/a_digest.c:82:9: Taking false branch
80.   
81.       i = i2d(data, NULL);
82.       if ((str = OPENSSL_malloc(i)) == NULL) {
              ^
83.           ASN1err(ASN1_F_ASN1_DIGEST, ERR_R_MALLOC_FAILURE);
84.           return (0);

crypto/asn1/a_digest.c:86:5: 
84.           return (0);
85.       }
86. >     p = str;
87.       i2d(data, &p);
88.   

crypto/asn1/a_digest.c:87:5: Skipping __function_pointer__(): unresolved function pointer
85.       }
86.       p = str;
87.       i2d(data, &p);
          ^
88.   
89.       if (!EVP_Digest(str, i, md, len, type, NULL))

crypto/asn1/a_digest.c:89:10: 
87.       i2d(data, &p);
88.   
89. >     if (!EVP_Digest(str, i, md, len, type, NULL))
90.           return 0;
91.       OPENSSL_free(str);

crypto/evp/digest.c:351:1: start of procedure EVP_Digest()
  349.   }
  350.   
  351. > int EVP_Digest(const void *data, size_t count,
  352.                  unsigned char *md, unsigned int *size, const EVP_MD *type,
  353.                  ENGINE *impl)

crypto/evp/digest.c:355:5: 
  353.                  ENGINE *impl)
  354.   {
  355. >     EVP_MD_CTX *ctx = EVP_MD_CTX_new();
  356.       int ret;
  357.   

crypto/evp/digest.c:153:1: start of procedure EVP_MD_CTX_new()
    151.   }
    152.   
    153. > EVP_MD_CTX *EVP_MD_CTX_new(void)
    154.   {
    155.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:155:5: 
    153.   EVP_MD_CTX *EVP_MD_CTX_new(void)
    154.   {
    155. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
    156.   }
    157.   

crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
      155.   }
      156.   
      157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      158.   {
      159.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:159:5: 
      157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      158.   {
      159. >     void *ret = CRYPTO_malloc(num, file, line);
      160.   
      161.       if (ret != NULL)

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

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

crypto/mem.c:124:9: Taking false branch
        122.       void *ret = NULL;
        123.   
        124.       if (num <= 0)
                       ^
        125.           return NULL;
        126.   

crypto/mem.c:127:5: 
        125.           return NULL;
        126.   
        127. >     allow_customize = 0;
        128.   #ifdef CRYPTO_MDEBUG
        129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
        135.       }
        136.   #else
        137. >     (void)file;
        138.       (void)line;
        139.       ret = malloc(num);

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

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

crypto/mem.c:154:5: 
        152.   #endif
        153.   
        154. >     return ret;
        155.   }
        156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
        153.   
        154.       return ret;
        155. > }
        156.   
        157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:161:9: Taking false branch
      159.       void *ret = CRYPTO_malloc(num, file, line);
      160.   
      161.       if (ret != NULL)
                     ^
      162.           memset(ret, 0, num);
      163.       return ret;

crypto/mem.c:163:5: 
      161.       if (ret != NULL)
      162.           memset(ret, 0, num);
      163. >     return ret;
      164.   }
      165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
      162.           memset(ret, 0, num);
      163.       return ret;
      164. > }
      165.   
      166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:156:1: return from a call to EVP_MD_CTX_new
    154.   {
    155.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
    156. > }
    157.   
    158.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/evp/digest.c:358:9: Taking true branch
  356.       int ret;
  357.   
  358.       if (ctx == NULL)
                 ^
  359.           return 0;
  360.       EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);

crypto/evp/digest.c:359:9: 
  357.   
  358.       if (ctx == NULL)
  359. >         return 0;
  360.       EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
  361.       ret = EVP_DigestInit_ex(ctx, type, impl)

crypto/evp/digest.c:367:1: return from a call to EVP_Digest
  365.   
  366.       return ret;
  367. > }
  368.   
  369.   int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)

crypto/asn1/a_digest.c:89:10: Taking true branch
87.       i2d(data, &p);
88.   
89.       if (!EVP_Digest(str, i, md, len, type, NULL))
               ^
90.           return 0;
91.       OPENSSL_free(str);

crypto/asn1/a_digest.c:90:9: 
88.   
89.       if (!EVP_Digest(str, i, md, len, type, NULL))
90. >         return 0;
91.       OPENSSL_free(str);
92.       return (1);
