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


crypto/asn1/a_digest.c:26:1: start of procedure ASN1_digest()
24.   #ifndef NO_ASN1_OLD
25.   
26. > int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
27.                   unsigned char *md, unsigned int *len)
28.   {

crypto/asn1/a_digest.c:32:5: Skipping __function_pointer__(): unresolved function pointer
30.       unsigned char *str, *p;
31.   
32.       i = i2d(data, NULL);
          ^
33.       if ((str = OPENSSL_malloc(i)) == NULL) {
34.           ASN1err(ASN1_F_ASN1_DIGEST, ERR_R_MALLOC_FAILURE);

crypto/asn1/a_digest.c:33:9: 
31.   
32.       i = i2d(data, NULL);
33. >     if ((str = OPENSSL_malloc(i)) == NULL) {
34.           ASN1err(ASN1_F_ASN1_DIGEST, ERR_R_MALLOC_FAILURE);
35.           return (0);

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

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

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

crypto/mem.c:165:9: Taking false branch
  163.           return malloc_impl(num, file, line);
  164.   
  165.       if (num <= 0)
                 ^
  166.           return NULL;
  167.   

crypto/mem.c:169:5: 
  167.   
  168.       FAILTEST();
  169. >     allow_customize = 0;
  170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
  177.       }
  178.   #else
  179. >     osslargused(file); osslargused(line);
  180.       ret = malloc(num);
  181.   #endif

crypto/mem.c:179:24: 
  177.       }
  178.   #else
  179. >     osslargused(file); osslargused(line);
  180.       ret = malloc(num);
  181.   #endif

crypto/mem.c:180:5: 
  178.   #else
  179.       osslargused(file); osslargused(line);
  180. >     ret = malloc(num);
  181.   #endif
  182.   

crypto/mem.c:183:5: 
  181.   #endif
  182.   
  183. >     return ret;
  184.   }
  185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
  182.   
  183.       return ret;
  184. > }
  185.   
  186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/asn1/a_digest.c:33:9: Taking false branch
31.   
32.       i = i2d(data, NULL);
33.       if ((str = OPENSSL_malloc(i)) == NULL) {
              ^
34.           ASN1err(ASN1_F_ASN1_DIGEST, ERR_R_MALLOC_FAILURE);
35.           return (0);

crypto/asn1/a_digest.c:37:5: 
35.           return (0);
36.       }
37. >     p = str;
38.       i2d(data, &p);
39.   

crypto/asn1/a_digest.c:38:5: Skipping __function_pointer__(): unresolved function pointer
36.       }
37.       p = str;
38.       i2d(data, &p);
          ^
39.   
40.       if (!EVP_Digest(str, i, md, len, type, NULL))

crypto/asn1/a_digest.c:40:10: Taking true branch
38.       i2d(data, &p);
39.   
40.       if (!EVP_Digest(str, i, md, len, type, NULL))
               ^
41.           return 0;
42.       OPENSSL_free(str);

crypto/asn1/a_digest.c:41:9: 
39.   
40.       if (!EVP_Digest(str, i, md, len, type, NULL))
41. >         return 0;
42.       OPENSSL_free(str);
43.       return (1);
