crypto/ec/ec_asn1.c:424: error: MEMORY_LEAK
  memory dynamically allocated by call to `BN_new()` at line 330, column 20 is not reachable after line 424, column 5.
Showing all 74 steps of the trace


crypto/ec/ec_asn1.c:310:1: start of procedure ec_asn1_group2fieldid()
308.   /* the function definitions */
309.   
310. > static int ec_asn1_group2fieldid(const EC_GROUP *group, X9_62_FIELDID *field)
311.   {
312.       int ok = 0, nid;

crypto/ec/ec_asn1.c:312:5: 
310.   static int ec_asn1_group2fieldid(const EC_GROUP *group, X9_62_FIELDID *field)
311.   {
312. >     int ok = 0, nid;
313.       BIGNUM *tmp = NULL;
314.   

crypto/ec/ec_asn1.c:313:5: 
311.   {
312.       int ok = 0, nid;
313. >     BIGNUM *tmp = NULL;
314.   
315.       if (group == NULL || field == NULL)

crypto/ec/ec_asn1.c:315:9: Taking false branch
313.       BIGNUM *tmp = NULL;
314.   
315.       if (group == NULL || field == NULL)
               ^
316.           return 0;
317.   

crypto/ec/ec_asn1.c:315:26: Taking false branch
313.       BIGNUM *tmp = NULL;
314.   
315.       if (group == NULL || field == NULL)
                                ^
316.           return 0;
317.   

crypto/ec/ec_asn1.c:319:5: Skipping ASN1_OBJECT_free(): empty list of specs
317.   
318.       /* clear the old values (if necessary) */
319.       ASN1_OBJECT_free(field->fieldType);
           ^
320.       ASN1_TYPE_free(field->p.other);
321.   

crypto/ec/ec_asn1.c:320:5: 
318.       /* clear the old values (if necessary) */
319.       ASN1_OBJECT_free(field->fieldType);
320. >     ASN1_TYPE_free(field->p.other);
321.   
322.       nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));

crypto/asn1/tasn_typ.c:101:1: start of procedure ASN1_TYPE_free()
  99.   IMPLEMENT_ASN1_TYPE(ASN1_SEQUENCE)
  100.   
  101. > IMPLEMENT_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
  102.   
  103.   /* Multistring types */

crypto/asn1/tasn_fre.c:70:1: start of procedure ASN1_item_free()
    68.   /* Free up an ASN1 structure */
    69.   
    70. > void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)
    71.   {
    72.       asn1_item_embed_free(&val, it, 0);

crypto/asn1/tasn_fre.c:72:5: Skipping asn1_item_embed_free(): empty list of specs
    70.   void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)
    71.   {
    72.       asn1_item_embed_free(&val, it, 0);
              ^
    73.   }
    74.   

crypto/asn1/tasn_fre.c:73:1: return from a call to ASN1_item_free
    71.   {
    72.       asn1_item_embed_free(&val, it, 0);
    73. > }
    74.   
    75.   void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it)

crypto/asn1/tasn_typ.c:101:1: return from a call to ASN1_TYPE_free
  99.   IMPLEMENT_ASN1_TYPE(ASN1_SEQUENCE)
  100.   
  101. > IMPLEMENT_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
  102.   
  103.   /* Multistring types */

crypto/ec/ec_asn1.c:322:5: 
320.       ASN1_TYPE_free(field->p.other);
321.   
322. >     nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
323.       /* set OID for the field */
324.       if ((field->fieldType = OBJ_nid2obj(nid)) == NULL) {

crypto/ec/ec_lib.c:292:1: start of procedure EC_GROUP_method_of()
  290.   }
  291.   
  292. > const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group)
  293.   {
  294.       return group->meth;

crypto/ec/ec_lib.c:294:5: 
  292.   const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group)
  293.   {
  294. >     return group->meth;
  295.   }
  296.   

crypto/ec/ec_lib.c:295:1: return from a call to EC_GROUP_method_of
  293.   {
  294.       return group->meth;
  295. > }
  296.   
  297.   int EC_METHOD_get_field_type(const EC_METHOD *meth)

crypto/ec/ec_lib.c:297:1: start of procedure EC_METHOD_get_field_type()
  295.   }
  296.   
  297. > int EC_METHOD_get_field_type(const EC_METHOD *meth)
  298.   {
  299.       return meth->field_type;

crypto/ec/ec_lib.c:299:5: 
  297.   int EC_METHOD_get_field_type(const EC_METHOD *meth)
  298.   {
  299. >     return meth->field_type;
  300.   }
  301.   

crypto/ec/ec_lib.c:300:1: return from a call to EC_METHOD_get_field_type
  298.   {
  299.       return meth->field_type;
  300. > }
  301.   
  302.   int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,

crypto/ec/ec_asn1.c:324:9: 
322.       nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
323.       /* set OID for the field */
324. >     if ((field->fieldType = OBJ_nid2obj(nid)) == NULL) {
325.           ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_OBJ_LIB);
326.           goto err;

crypto/objects/obj_dat.c:284:1: start of procedure OBJ_nid2obj()
  282.   }
  283.   
  284. > ASN1_OBJECT *OBJ_nid2obj(int n)
  285.   {
  286.       ADDED_OBJ ad, *adp;

crypto/objects/obj_dat.c:289:10: Taking true branch
  287.       ASN1_OBJECT ob;
  288.   
  289.       if ((n >= 0) && (n < NUM_NID)) {
                  ^
  290.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
  291.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:289:22: Taking true branch
  287.       ASN1_OBJECT ob;
  288.   
  289.       if ((n >= 0) && (n < NUM_NID)) {
                              ^
  290.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
  291.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:290:14: Taking true branch
  288.   
  289.       if ((n >= 0) && (n < NUM_NID)) {
  290.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
                      ^
  291.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);
  292.               return (NULL);

crypto/objects/obj_dat.c:290:34: Taking false branch
  288.   
  289.       if ((n >= 0) && (n < NUM_NID)) {
  290.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
                                          ^
  291.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);
  292.               return (NULL);

crypto/objects/obj_dat.c:294:9: 
  292.               return (NULL);
  293.           }
  294. >         return ((ASN1_OBJECT *)&(nid_objs[n]));
  295.       } else if (added == NULL)
  296.           return (NULL);

crypto/objects/obj_dat.c:309:1: return from a call to OBJ_nid2obj
  307.           }
  308.       }
  309. > }
  310.   
  311.   const char *OBJ_nid2sn(int n)

crypto/ec/ec_asn1.c:324:9: Taking false branch
322.       nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
323.       /* set OID for the field */
324.       if ((field->fieldType = OBJ_nid2obj(nid)) == NULL) {
               ^
325.           ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_OBJ_LIB);
326.           goto err;

crypto/ec/ec_asn1.c:329:9: Taking true branch
327.       }
328.   
329.       if (nid == NID_X9_62_prime_field) {
               ^
330.           if ((tmp = BN_new()) == NULL) {
331.               ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_MALLOC_FAILURE);

crypto/ec/ec_asn1.c:330:13: 
328.   
329.       if (nid == NID_X9_62_prime_field) {
330. >         if ((tmp = BN_new()) == NULL) {
331.               ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_MALLOC_FAILURE);
332.               goto err;

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/ec/ec_asn1.c:330:13: Taking false branch
328.   
329.       if (nid == NID_X9_62_prime_field) {
330.           if ((tmp = BN_new()) == NULL) {
                   ^
331.               ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_MALLOC_FAILURE);
332.               goto err;

crypto/ec/ec_asn1.c:335:14: 
333.           }
334.           /* the parameters are specified by the prime number p */
335. >         if (!EC_GROUP_get_curve_GFp(group, tmp, NULL, NULL, NULL)) {
336.               ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_EC_LIB);
337.               goto err;

crypto/ec/ec_lib.c:463:1: start of procedure EC_GROUP_get_curve_GFp()
  461.   }
  462.   
  463. > int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,
  464.                              BIGNUM *b, BN_CTX *ctx)
  465.   {

crypto/ec/ec_lib.c:466:9: Taking true branch
  464.                              BIGNUM *b, BN_CTX *ctx)
  465.   {
  466.       if (group->meth->group_get_curve == 0) {
                 ^
  467.           ECerr(EC_F_EC_GROUP_GET_CURVE_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  468.           return 0;

crypto/ec/ec_lib.c:467:9: Skipping ERR_put_error(): empty list of specs
  465.   {
  466.       if (group->meth->group_get_curve == 0) {
  467.           ECerr(EC_F_EC_GROUP_GET_CURVE_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                 ^
  468.           return 0;
  469.       }

crypto/ec/ec_lib.c:468:9: 
  466.       if (group->meth->group_get_curve == 0) {
  467.           ECerr(EC_F_EC_GROUP_GET_CURVE_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  468. >         return 0;
  469.       }
  470.       return group->meth->group_get_curve(group, p, a, b, ctx);

crypto/ec/ec_lib.c:471:1: return from a call to EC_GROUP_get_curve_GFp
  469.       }
  470.       return group->meth->group_get_curve(group, p, a, b, ctx);
  471. > }
  472.   
  473.   #ifndef OPENSSL_NO_EC2M

crypto/ec/ec_asn1.c:335:14: Taking true branch
333.           }
334.           /* the parameters are specified by the prime number p */
335.           if (!EC_GROUP_get_curve_GFp(group, tmp, NULL, NULL, NULL)) {
                    ^
336.               ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_EC_LIB);
337.               goto err;

crypto/ec/ec_asn1.c:336:13: Skipping ERR_put_error(): empty list of specs
334.           /* the parameters are specified by the prime number p */
335.           if (!EC_GROUP_get_curve_GFp(group, tmp, NULL, NULL, NULL)) {
336.               ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_EC_LIB);
                   ^
337.               goto err;
338.           }

crypto/ec/ec_asn1.c:423:2: 
421.       ok = 1;
422.   
423. >  err:
424.       BN_free(tmp);
425.       return (ok);

crypto/ec/ec_asn1.c:424:5: 
422.   
423.    err:
424. >     BN_free(tmp);
425.       return (ok);
426.   }

crypto/bn/bn_lib.c:251:1: start of procedure BN_free()
  249.   }
  250.   
  251. > void BN_free(BIGNUM *a)
  252.   {
  253.       if (a == NULL)

crypto/bn/bn_lib.c:253:9: Taking false branch
  251.   void BN_free(BIGNUM *a)
  252.   {
  253.       if (a == NULL)
                 ^
  254.           return;
  255.       bn_check_top(a);

crypto/bn/bn_lib.c:256:10: 
  254.           return;
  255.       bn_check_top(a);
  256. >     if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  257.           bn_free_d(a);
  258.       if (a->flags & BN_FLG_MALLOCED)

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:256:10: Taking false branch
  254.           return;
  255.       bn_check_top(a);
  256.       if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
                  ^
  257.           bn_free_d(a);
  258.       if (a->flags & BN_FLG_MALLOCED)

crypto/bn/bn_lib.c:258:9: Taking false branch
  256.       if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  257.           bn_free_d(a);
  258.       if (a->flags & BN_FLG_MALLOCED)
                 ^
  259.           OPENSSL_free(a);
  260.       else {

crypto/bn/bn_lib.c:262:9: 
  260.       else {
  261.   #if OPENSSL_API_COMPAT < 0x00908000L
  262. >         a->flags |= BN_FLG_FREE;
  263.   #endif
  264.           a->d = NULL;

crypto/bn/bn_lib.c:264:9: 
  262.           a->flags |= BN_FLG_FREE;
  263.   #endif
  264. >         a->d = NULL;
  265.       }
  266.   }

crypto/bn/bn_lib.c:258:5: 
  256.       if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  257.           bn_free_d(a);
  258. >     if (a->flags & BN_FLG_MALLOCED)
  259.           OPENSSL_free(a);
  260.       else {

crypto/bn/bn_lib.c:266:1: return from a call to BN_free
  264.           a->d = NULL;
  265.       }
  266. > }
  267.   
  268.   void bn_init(BIGNUM *a)
