test/ecdsatest.c:171: error: MEMORY_LEAK
  memory dynamically allocated by call to `BN_new()` at line 168, column 11 is not reachable after line 171, column 10.
Showing all 29 steps of the trace


test/ecdsatest.c:156:1: start of procedure fbytes()
154.   };
155.   
156. > int fbytes(unsigned char *buf, int num)
157.   {
158.       int ret;

test/ecdsatest.c:159:5: 
157.   {
158.       int ret;
159. >     BIGNUM *tmp = NULL;
160.   
161.       if (use_fake == 0)

test/ecdsatest.c:161:9: Taking false branch
159.       BIGNUM *tmp = NULL;
160.   
161.       if (use_fake == 0)
               ^
162.           return old_rand->bytes(buf, num);
163.   

test/ecdsatest.c:164:5: 
162.           return old_rand->bytes(buf, num);
163.   
164. >     use_fake = 0;
165.   
166.       if (fbytes_counter >= 8)

test/ecdsatest.c:166:9: Taking false branch
164.       use_fake = 0;
165.   
166.       if (fbytes_counter >= 8)
               ^
167.           return 0;
168.       tmp = BN_new();

test/ecdsatest.c:168:5: 
166.       if (fbytes_counter >= 8)
167.           return 0;
168. >     tmp = BN_new();
169.       if (!tmp)
170.           return 0;

crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
  275.   }
  276.   
  277. > BIGNUM *BN_new(void)
  278.   {
  279.       BIGNUM *ret;

crypto/bn/bn_lib.c:281:9: 
  279.       BIGNUM *ret;
  280.   
  281. >     if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
  282.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  283.           return (NULL);

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 true 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:162:9: 
    160.   
    161.       if (ret != NULL)
    162. >         memset(ret, 0, num);
    163.       return ret;
    164.   }

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/bn/bn_lib.c:281:9: Taking false branch
  279.       BIGNUM *ret;
  280.   
  281.       if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
                 ^
  282.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
  283.           return (NULL);

crypto/bn/bn_lib.c:285:5: 
  283.           return (NULL);
  284.       }
  285. >     ret->flags = BN_FLG_MALLOCED;
  286.       bn_check_top(ret);
  287.       return (ret);

crypto/bn/bn_lib.c:287:5: 
  285.       ret->flags = BN_FLG_MALLOCED;
  286.       bn_check_top(ret);
  287. >     return (ret);
  288.   }
  289.   

crypto/bn/bn_lib.c:288:1: return from a call to BN_new
  286.       bn_check_top(ret);
  287.       return (ret);
  288. > }
  289.   
  290.    BIGNUM *BN_secure_new(void)

test/ecdsatest.c:169:10: Taking false branch
167.           return 0;
168.       tmp = BN_new();
169.       if (!tmp)
                ^
170.           return 0;
171.       if (!BN_dec2bn(&tmp, numbers[fbytes_counter])) {

test/ecdsatest.c:171:10: Skipping BN_dec2bn(): empty list of specs
169.       if (!tmp)
170.           return 0;
171.       if (!BN_dec2bn(&tmp, numbers[fbytes_counter])) {
                ^
172.           BN_free(tmp);
173.           return 0;
