crypto/bn/bn_blind.c:168: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_zalloc()` at line 140, column 16 is not reachable after line 168, column 5.
Showing all 42 steps of the trace


crypto/bn/bn_blind.c:134:1: start of procedure BN_BLINDING_new()
132.   };
133.   
134. > BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
135.   {
136.       BN_BLINDING *ret = NULL;

crypto/bn/bn_blind.c:136:5: 
134.   BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
135.   {
136. >     BN_BLINDING *ret = NULL;
137.   
138.       bn_check_top(mod);

crypto/bn/bn_blind.c:140:9: 
138.       bn_check_top(mod);
139.   
140. >     if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
141.           BNerr(BN_F_BN_BLINDING_NEW, ERR_R_MALLOC_FAILURE);
142.           return (NULL);

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

crypto/mem.c:161:5: 
  159.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  160.   {
  161. >     void *ret = CRYPTO_malloc(num, file, line);
  162.   
  163.       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. >     (void)file;
    140.       (void)line;
    141.       ret = malloc(num);

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

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

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

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

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

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

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

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

crypto/bn/bn_blind.c:140:9: Taking false branch
138.       bn_check_top(mod);
139.   
140.       if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
               ^
141.           BNerr(BN_F_BN_BLINDING_NEW, ERR_R_MALLOC_FAILURE);
142.           return (NULL);

crypto/bn/bn_blind.c:144:9: Taking false branch
142.           return (NULL);
143.       }
144.       if (A != NULL) {
               ^
145.           if ((ret->A = BN_dup(A)) == NULL)
146.               goto err;

crypto/bn/bn_blind.c:148:9: Taking false branch
146.               goto err;
147.       }
148.       if (Ai != NULL) {
               ^
149.           if ((ret->Ai = BN_dup(Ai)) == NULL)
150.               goto err;

crypto/bn/bn_blind.c:154:9: 
152.   
153.       /* save a copy of mod in the BN_BLINDING structure */
154. >     if ((ret->mod = BN_dup(mod)) == NULL)
155.           goto err;
156.       if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)

crypto/bn/bn_lib.c:400:1: start of procedure BN_dup()
  398.   }
  399.   
  400. > BIGNUM *BN_dup(const BIGNUM *a)
  401.   {
  402.       BIGNUM *t;

crypto/bn/bn_lib.c:404:9: Taking false branch
  402.       BIGNUM *t;
  403.   
  404.       if (a == NULL)
                 ^
  405.           return NULL;
  406.       bn_check_top(a);

crypto/bn/bn_lib.c:408:9: 
  406.       bn_check_top(a);
  407.   
  408. >     t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
  409.       if (t == NULL)
  410.           return NULL;

crypto/bn/bn_lib.c:1041:1: start of procedure BN_get_flags()
    1039.   }
    1040.   
    1041. > int BN_get_flags(const BIGNUM *b, int n)
    1042.   {
    1043.       return b->flags & n;

crypto/bn/bn_lib.c:1043:5: 
    1041.   int BN_get_flags(const BIGNUM *b, int n)
    1042.   {
    1043. >     return b->flags & n;
    1044.   }
    1045.   

crypto/bn/bn_lib.c:1044:1: return from a call to BN_get_flags
    1042.   {
    1043.       return b->flags & n;
    1044. > }
    1045.   
    1046.   /* Populate a BN_GENCB structure with an "old"-style callback */

crypto/bn/bn_lib.c:408:9: Condition is true
  406.       bn_check_top(a);
  407.   
  408.       t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
                 ^
  409.       if (t == NULL)
  410.           return NULL;

crypto/bn/bn_lib.c:289:2: start of procedure BN_secure_new()
    287.   }
    288.   
    289.    BIGNUM *BN_secure_new(void)
            ^
    290.    {
    291.        BIGNUM *ret = BN_new();

crypto/bn/bn_lib.c:291:6: Skipping BN_new(): empty list of specs
    289.    BIGNUM *BN_secure_new(void)
    290.    {
    291.        BIGNUM *ret = BN_new();
                ^
    292.        if (ret != NULL)
    293.            ret->flags |= BN_FLG_SECURE;

crypto/bn/bn_lib.c:292:10: Taking false branch
    290.    {
    291.        BIGNUM *ret = BN_new();
    292.        if (ret != NULL)
                    ^
    293.            ret->flags |= BN_FLG_SECURE;
    294.        return (ret);

crypto/bn/bn_lib.c:294:6: 
    292.        if (ret != NULL)
    293.            ret->flags |= BN_FLG_SECURE;
    294. >      return (ret);
    295.    }
    296.   

crypto/bn/bn_lib.c:295:2: return from a call to BN_secure_new
    293.            ret->flags |= BN_FLG_SECURE;
    294.        return (ret);
    295.    }
            ^
    296.   
    297.   /* This is used by bn_expand2() */

crypto/bn/bn_lib.c:408:5: 
  406.       bn_check_top(a);
  407.   
  408. >     t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
  409.       if (t == NULL)
  410.           return NULL;

crypto/bn/bn_lib.c:409:9: Taking true branch
  407.   
  408.       t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
  409.       if (t == NULL)
                 ^
  410.           return NULL;
  411.       if (!BN_copy(t, a)) {

crypto/bn/bn_lib.c:410:9: 
  408.       t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
  409.       if (t == NULL)
  410. >         return NULL;
  411.       if (!BN_copy(t, a)) {
  412.           BN_free(t);

crypto/bn/bn_lib.c:417:1: return from a call to BN_dup
  415.       bn_check_top(t);
  416.       return t;
  417. > }
  418.   
  419.   BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)

crypto/bn/bn_blind.c:154:9: Taking true branch
152.   
153.       /* save a copy of mod in the BN_BLINDING structure */
154.       if ((ret->mod = BN_dup(mod)) == NULL)
               ^
155.           goto err;
156.       if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)

crypto/bn/bn_blind.c:167:2: 
165.       CRYPTO_THREADID_current(&ret->tid);
166.       return (ret);
167. >  err:
168.       BN_BLINDING_free(ret);
169.       return (NULL);

crypto/bn/bn_blind.c:168:5: Skipping BN_BLINDING_free(): empty list of specs
166.       return (ret);
167.    err:
168.       BN_BLINDING_free(ret);
           ^
169.       return (NULL);
170.   }
