crypto/srp/srp_lib.c:150: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 125, column 12 is not reachable after line 150, column 5.
Showing all 67 steps of the trace


crypto/srp/srp_lib.c:115:1: start of procedure SRP_Calc_x()
113.   }
114.   
115. > BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass)
116.   {
117.       unsigned char dig[SHA_DIGEST_LENGTH];

crypto/srp/srp_lib.c:119:5: 
117.       unsigned char dig[SHA_DIGEST_LENGTH];
118.       EVP_MD_CTX *ctxt;
119. >     unsigned char *cs = NULL;
120.       BIGNUM *res = NULL;
121.   

crypto/srp/srp_lib.c:120:5: 
118.       EVP_MD_CTX *ctxt;
119.       unsigned char *cs = NULL;
120. >     BIGNUM *res = NULL;
121.   
122.       if ((s == NULL) || (user == NULL) || (pass == NULL))

crypto/srp/srp_lib.c:122:10: Taking false branch
120.       BIGNUM *res = NULL;
121.   
122.       if ((s == NULL) || (user == NULL) || (pass == NULL))
                ^
123.           return NULL;
124.   

crypto/srp/srp_lib.c:122:25: Taking false branch
120.       BIGNUM *res = NULL;
121.   
122.       if ((s == NULL) || (user == NULL) || (pass == NULL))
                               ^
123.           return NULL;
124.   

crypto/srp/srp_lib.c:122:43: Taking false branch
120.       BIGNUM *res = NULL;
121.   
122.       if ((s == NULL) || (user == NULL) || (pass == NULL))
                                                 ^
123.           return NULL;
124.   

crypto/srp/srp_lib.c:125:5: 
123.           return NULL;
124.   
125. >     ctxt = EVP_MD_CTX_new();
126.       if (ctxt == NULL)
127.           return NULL;

crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
  42.   }
  43.   
  44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:46:5: 
  44.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47.   }
  48.   

crypto/mem.c:197:1: start of procedure CRYPTO_zalloc()
    195.   }
    196.   
    197. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:199:5: 
    197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199. >     void *ret = CRYPTO_malloc(num, file, line);
    200.   
    201.       FAILTEST();

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
      167.   #endif
      168.   
      169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171.       void *ret = NULL;

crypto/mem.c:171:5: 
      169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171. >     void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking false branch
      171.       void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      174.           return malloc_impl(num, file, line);
      175.   

crypto/mem.c:176:9: Taking false branch
      174.           return malloc_impl(num, file, line);
      175.   
      176.       if (num == 0)
                     ^
      177.           return NULL;
      178.   

crypto/mem.c:180:5: 
      178.   
      179.       FAILTEST();
      180. >     allow_customize = 0;
      181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
      188.       }
      189.   #else
      190. >     (void)(file); (void)(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:190:19: 
      188.       }
      189.   #else
      190. >     (void)(file); (void)(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:191:5: 
      189.   #else
      190.       (void)(file); (void)(line);
      191. >     ret = malloc(num);
      192.   #endif
      193.   

crypto/mem.c:194:5: 
      192.   #endif
      193.   
      194. >     return ret;
      195.   }
      196.   

crypto/mem.c:195:1: return from a call to CRYPTO_malloc
      193.   
      194.       return ret;
      195. > }
      196.   
      197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:202:9: Taking true branch
    200.   
    201.       FAILTEST();
    202.       if (ret != NULL)
                   ^
    203.           memset(ret, 0, num);
    204.       return ret;

crypto/mem.c:203:9: 
    201.       FAILTEST();
    202.       if (ret != NULL)
    203. >         memset(ret, 0, num);
    204.       return ret;
    205.   }

crypto/mem.c:204:5: 
    202.       if (ret != NULL)
    203.           memset(ret, 0, num);
    204. >     return ret;
    205.   }
    206.   

crypto/mem.c:205:1: return from a call to CRYPTO_zalloc
    203.           memset(ret, 0, num);
    204.       return ret;
    205. > }
    206.   
    207.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47. > }
  48.   
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/srp/srp_lib.c:126:9: Taking false branch
124.   
125.       ctxt = EVP_MD_CTX_new();
126.       if (ctxt == NULL)
               ^
127.           return NULL;
128.       if ((cs = OPENSSL_malloc(BN_num_bytes(s))) == NULL)

crypto/srp/srp_lib.c:128:9: 
126.       if (ctxt == NULL)
127.           return NULL;
128. >     if ((cs = OPENSSL_malloc(BN_num_bytes(s))) == NULL)
129.           goto err;
130.   

crypto/bn/bn_lib.c:161:1: start of procedure BN_num_bits()
  159.   }
  160.   
  161. > int BN_num_bits(const BIGNUM *a)
  162.   {
  163.       int i = a->top - 1;

crypto/bn/bn_lib.c:163:5: 
  161.   int BN_num_bits(const BIGNUM *a)
  162.   {
  163. >     int i = a->top - 1;
  164.       bn_check_top(a);
  165.   

crypto/bn/bn_lib.c:166:9: 
  164.       bn_check_top(a);
  165.   
  166. >     if (BN_is_zero(a))
  167.           return 0;
  168.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:852:1: start of procedure BN_is_zero()
    850.   }
    851.   
    852. > int BN_is_zero(const BIGNUM *a)
    853.   {
    854.       return a->top == 0;

crypto/bn/bn_lib.c:854:12: Condition is false
    852.   int BN_is_zero(const BIGNUM *a)
    853.   {
    854.       return a->top == 0;
                      ^
    855.   }
    856.   

crypto/bn/bn_lib.c:854:5: 
    852.   int BN_is_zero(const BIGNUM *a)
    853.   {
    854. >     return a->top == 0;
    855.   }
    856.   

crypto/bn/bn_lib.c:855:1: return from a call to BN_is_zero
    853.   {
    854.       return a->top == 0;
    855. > }
    856.   
    857.   int BN_is_one(const BIGNUM *a)

crypto/bn/bn_lib.c:166:9: Taking false branch
  164.       bn_check_top(a);
  165.   
  166.       if (BN_is_zero(a))
                 ^
  167.           return 0;
  168.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:168:5: Skipping BN_num_bits_word(): empty list of specs
  166.       if (BN_is_zero(a))
  167.           return 0;
  168.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
             ^
  169.   }
  170.   

crypto/bn/bn_lib.c:169:1: return from a call to BN_num_bits
  167.           return 0;
  168.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
  169. > }
  170.   
  171.   static void bn_free_d(BIGNUM *a)

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
  167.   #endif
  168.   
  169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  170.   {
  171.       void *ret = NULL;

crypto/mem.c:171:5: 
  169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  170.   {
  171. >     void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking true branch
  171.       void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  174.           return malloc_impl(num, file, line);
  175.   

crypto/mem.c:173:32: Taking true branch
  171.       void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                        ^
  174.           return malloc_impl(num, file, line);
  175.   

crypto/mem.c:174:9: Skipping __function_pointer__(): unresolved function pointer
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
  174.           return malloc_impl(num, file, line);
                 ^
  175.   
  176.       if (num == 0)

crypto/mem.c:195:1: return from a call to CRYPTO_malloc
  193.   
  194.       return ret;
  195. > }
  196.   
  197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/srp/srp_lib.c:128:9: Taking false branch
126.       if (ctxt == NULL)
127.           return NULL;
128.       if ((cs = OPENSSL_malloc(BN_num_bytes(s))) == NULL)
               ^
129.           goto err;
130.   

crypto/srp/srp_lib.c:131:10: 
129.           goto err;
130.   
131. >     if (!EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL)
132.           || !EVP_DigestUpdate(ctxt, user, strlen(user))
133.           || !EVP_DigestUpdate(ctxt, ":", 1)

crypto/evp/m_sha1.c:108:1: start of procedure EVP_sha1()
  106.   };
  107.   
  108. > const EVP_MD *EVP_sha1(void)
  109.   {
  110.       return (&sha1_md);

crypto/evp/m_sha1.c:110:5: 
  108.   const EVP_MD *EVP_sha1(void)
  109.   {
  110. >     return (&sha1_md);
  111.   }
  112.   

crypto/evp/m_sha1.c:111:1: return from a call to EVP_sha1
  109.   {
  110.       return (&sha1_md);
  111. > }
  112.   
  113.   static int init224(EVP_MD_CTX *ctx)

crypto/srp/srp_lib.c:131:10: Taking true branch
129.           goto err;
130.   
131.       if (!EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL)
                ^
132.           || !EVP_DigestUpdate(ctxt, user, strlen(user))
133.           || !EVP_DigestUpdate(ctxt, ":", 1)

crypto/srp/srp_lib.c:148:2: 
146.       res = BN_bin2bn(dig, sizeof(dig), NULL);
147.   
148. >  err:
149.       OPENSSL_free(cs);
150.       EVP_MD_CTX_free(ctxt);

crypto/srp/srp_lib.c:149:5: 
147.   
148.    err:
149. >     OPENSSL_free(cs);
150.       EVP_MD_CTX_free(ctxt);
151.       return res;

crypto/mem.c:264:1: start of procedure CRYPTO_free()
  262.   }
  263.   
  264. > void CRYPTO_free(void *str, const char *file, int line)
  265.   {
  266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:266:9: Taking false branch
  264.   void CRYPTO_free(void *str, const char *file, int line)
  265.   {
  266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                 ^
  267.           free_impl(str, file, line);
  268.           return;

crypto/mem.c:280:5: 
  278.       }
  279.   #else
  280. >     free(str);
  281.   #endif
  282.   }

crypto/mem.c:282:1: return from a call to CRYPTO_free
  280.       free(str);
  281.   #endif
  282. > }
  283.   
  284.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/srp/srp_lib.c:150:5: 
148.    err:
149.       OPENSSL_free(cs);
150. >     EVP_MD_CTX_free(ctxt);
151.       return res;
152.   }

crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
  47.   }
  48.   
  49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
            ^
  52.       OPENSSL_free(ctx);
  53.   }

crypto/evp/digest.c:52:5: 
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
  52. >     OPENSSL_free(ctx);
  53.   }
  54.   

crypto/mem.c:264:1: start of procedure CRYPTO_free()
    262.   }
    263.   
    264. > void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:266:9: Taking true branch
    264.   void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    267.           free_impl(str, file, line);
    268.           return;

crypto/mem.c:266:30: Taking true branch
    264.   void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    267.           free_impl(str, file, line);
    268.           return;

crypto/mem.c:267:9: Skipping __function_pointer__(): unresolved function pointer
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    267.           free_impl(str, file, line);
                   ^
    268.           return;
    269.       }

crypto/mem.c:268:9: 
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    267.           free_impl(str, file, line);
    268. >         return;
    269.       }
    270.   

crypto/mem.c:282:1: return from a call to CRYPTO_free
    280.       free(str);
    281.   #endif
    282. > }
    283.   
    284.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
  51.       EVP_MD_CTX_reset(ctx);
  52.       OPENSSL_free(ctx);
  53. > }
  54.   
  55.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
