crypto/bn/bn_blind.c:168: error: MEMORY_LEAK
  memory dynamically allocated by call to `BN_dup()` at line 149, column 24 is not reachable after line 168, column 5.
Showing all 91 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:156:1: start of procedure CRYPTO_zalloc()
  154.   }
  155.   
  156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  157.   {
  158.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:158:5: 
  156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  157.   {
  158. >     void *ret = CRYPTO_malloc(num, file, line);
  159.   
  160.       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 (num <= 0)

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

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

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

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

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

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

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

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

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

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

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
  161.           memset(ret, 0, num);
  162.       return ret;
  163. > }
  164.   
  165.   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 true 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:149:13: 
147.       }
148.       if (Ai != NULL) {
149. >         if ((ret->Ai = BN_dup(Ai)) == NULL)
150.               goto err;
151.       }

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 false
  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:276:1: start of procedure BN_new()
    274.   }
    275.   
    276. > BIGNUM *BN_new(void)
    277.   {
    278.       BIGNUM *ret;

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

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

crypto/mem.c:158:5: 
      156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      157.   {
      158. >     void *ret = CRYPTO_malloc(num, file, line);
      159.   
      160.       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 (num <= 0)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 false 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:411:10: Taking false branch
  409.       if (t == NULL)
  410.           return NULL;
  411.       if (!BN_copy(t, a)) {
                  ^
  412.           BN_free(t);
  413.           return NULL;

crypto/bn/bn_lib.c:416:5: 
  414.       }
  415.       bn_check_top(t);
  416. >     return t;
  417.   }
  418.   

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:149:13: Taking false branch
147.       }
148.       if (Ai != NULL) {
149.           if ((ret->Ai = BN_dup(Ai)) == NULL)
                   ^
150.               goto err;
151.       }

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 false
  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:276:1: start of procedure BN_new()
    274.   }
    275.   
    276. > BIGNUM *BN_new(void)
    277.   {
    278.       BIGNUM *ret;

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

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

crypto/mem.c:158:5: 
      156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      157.   {
      158. >     void *ret = CRYPTO_malloc(num, file, line);
      159.   
      160.       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 (num <= 0)

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

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

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

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

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

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

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

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

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

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

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

crypto/bn/bn_lib.c:281:9: Skipping ERR_put_error(): empty list of specs
    279.   
    280.       if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
    281.           BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
                   ^
    282.           return (NULL);
    283.       }

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

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

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.   }

BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
{
    BN_BLINDING *ret = NULL;
    bn_check_top(mod);
    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
        BNerr(BN_F_BN_BLINDING_NEW, ERR_R_MALLOC_FAILURE);
        return (NULL);
    }
    if (A != NULL) {
        if ((ret->A = BN_dup(A)) == NULL)
            goto err;
    }
    if (Ai != NULL) {
        if ((ret->Ai = BN_dup(Ai)) == NULL)
            goto err;
    }
    if ((ret->mod = BN_dup(mod)) == NULL)
        goto err;
    if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
        BN_set_flags(ret->mod, BN_FLG_CONSTTIME);
    ret->counter = -1;
    CRYPTO_THREADID_current(&ret->tid);
    return (ret);
 err:
    BN_BLINDING_free(ret);
    return (NULL);
}
['BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)\n{\n    BN_BLINDING *ret = NULL;\n    bn_check_top(mod);\n    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {\n        BNerr(BN_F_BN_BLINDING_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    if (A != NULL) {\n        if ((ret->A = BN_dup(A)) == NULL)\n            goto err;\n    }\n    if (Ai != NULL) {\n        if ((ret->Ai = BN_dup(Ai)) == NULL)\n            goto err;\n    }\n    if ((ret->mod = BN_dup(mod)) == NULL)\n        goto err;\n    if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)\n        BN_set_flags(ret->mod, BN_FLG_CONSTTIME);\n    ret->counter = -1;\n    CRYPTO_THREADID_current(&ret->tid);\n    return (ret);\n err:\n    BN_BLINDING_free(ret);\n    return (NULL);\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'BIGNUM *BN_dup(const BIGNUM *a)\n{\n    BIGNUM *t;\n    if (a == NULL)\n        return NULL;\n    bn_check_top(a);\n    t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();\n    if (t == NULL)\n        return NULL;\n    if (!BN_copy(t, a)) {\n        BN_free(t);\n        return NULL;\n    }\n    bn_check_top(t);\n    return t;\n}', 'int BN_get_flags(const BIGNUM *b, int n)\n{\n    return b->flags & n;\n}', 'BIGNUM *BN_new(void)\n{\n    BIGNUM *ret;\n    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {\n        BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    ret->flags = BN_FLG_MALLOCED;\n    bn_check_top(ret);\n    return (ret);\n}']