crypto/ec/ec_kmeth.c:130: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_zalloc()` at line 98, column 19 is not reachable after line 130, column 9.
Showing all 65 steps of the trace


crypto/ec/ec_kmeth.c:96:1: start of procedure EC_KEY_new_method()
94.   }
95.   
96. > EC_KEY *EC_KEY_new_method(ENGINE *engine)
97.   {
98.       EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));

crypto/ec/ec_kmeth.c:98:5: 
96.   EC_KEY *EC_KEY_new_method(ENGINE *engine)
97.   {
98. >     EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
99.   
100.       if (ret == 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/ec/ec_kmeth.c:100:9: Taking false branch
98.       EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
99.   
100.       if (ret == NULL) {
               ^
101.           ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_MALLOC_FAILURE);
102.           return (NULL);

crypto/ec/ec_kmeth.c:104:5: 
102.           return (NULL);
103.       }
104. >     ret->meth = EC_KEY_get_default_method();
105.   #ifndef OPENSSL_NO_ENGINE
106.       if (engine != NULL) {

crypto/ec/ec_kmeth.c:83:1: start of procedure EC_KEY_get_default_method()
  81.   }
  82.   
  83. > const EC_KEY_METHOD *EC_KEY_get_default_method(void)
  84.   {
  85.       return default_ec_key_meth;

crypto/ec/ec_kmeth.c:85:5: 
  83.   const EC_KEY_METHOD *EC_KEY_get_default_method(void)
  84.   {
  85. >     return default_ec_key_meth;
  86.   }
  87.   

crypto/ec/ec_kmeth.c:86:1: return from a call to EC_KEY_get_default_method
  84.   {
  85.       return default_ec_key_meth;
  86. > }
  87.   
  88.   void EC_KEY_set_default_method(const EC_KEY_METHOD *meth)

crypto/ec/ec_kmeth.c:106:9: Taking true branch
104.       ret->meth = EC_KEY_get_default_method();
105.   #ifndef OPENSSL_NO_ENGINE
106.       if (engine != NULL) {
               ^
107.           if (!ENGINE_init(engine)) {
108.               ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_ENGINE_LIB);

crypto/ec/ec_kmeth.c:107:14: 
105.   #ifndef OPENSSL_NO_ENGINE
106.       if (engine != NULL) {
107. >         if (!ENGINE_init(engine)) {
108.               ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_ENGINE_LIB);
109.               OPENSSL_free(ret);

crypto/engine/eng_init.c:127:1: start of procedure ENGINE_init()
  125.   
  126.   /* The API (locked) version of "init" */
  127. > int ENGINE_init(ENGINE *e)
  128.   {
  129.       int ret;

crypto/engine/eng_init.c:130:9: Taking false branch
  128.   {
  129.       int ret;
  130.       if (e == NULL) {
                 ^
  131.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_PASSED_NULL_PARAMETER);
  132.           return 0;

crypto/engine/eng_init.c:134:5: 
  132.           return 0;
  133.       }
  134. >     CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
  135.       ret = engine_unlocked_init(e);
  136.       CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
    412.   }
    413.   
    414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
    415.   {
    416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
    439.       }
    440.   #endif
    441.       if (type < 0) {
                   ^
    442.           if (dynlock_lock_callback != NULL) {
    443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking true branch
    450.               CRYPTO_destroy_dynlockid(type);
    451.           }
    452.       } else if (locking_callback != NULL)
                          ^
    453.           locking_callback(mode, type, file, line);
    454.   }

crypto/lock.c:453:9: Skipping __function_pointer__(): unresolved function pointer
    451.           }
    452.       } else if (locking_callback != NULL)
    453.           locking_callback(mode, type, file, line);
                   ^
    454.   }
    455.   

crypto/lock.c:441:5: 
    439.       }
    440.   #endif
    441. >     if (type < 0) {
    442.           if (dynlock_lock_callback != NULL) {
    443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
    452.       } else if (locking_callback != NULL)
    453.           locking_callback(mode, type, file, line);
    454. > }
    455.   
    456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/engine/eng_init.c:135:5: 
  133.       }
  134.       CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
  135. >     ret = engine_unlocked_init(e);
  136.       CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
  137.       return ret;

crypto/engine/eng_init.c:62:1: start of procedure engine_unlocked_init()
    60.    * it's already in use). This version is only used internally.
    61.    */
    62. > int engine_unlocked_init(ENGINE *e)
    63.   {
    64.       int to_return = 1;

crypto/engine/eng_init.c:64:5: 
    62.   int engine_unlocked_init(ENGINE *e)
    63.   {
    64. >     int to_return = 1;
    65.   
    66.       if ((e->funct_ref == 0) && e->init)

crypto/engine/eng_init.c:66:10: Taking false branch
    64.       int to_return = 1;
    65.   
    66.       if ((e->funct_ref == 0) && e->init)
                   ^
    67.           /*
    68.            * This is the first functional reference and the engine requires

crypto/engine/eng_init.c:72:9: Taking true branch
    70.            */
    71.           to_return = e->init(e);
    72.       if (to_return) {
                  ^
    73.           /*
    74.            * OK, we return a functional reference which is also a structural

crypto/engine/eng_init.c:77:9: 
    75.            * reference.
    76.            */
    77. >         e->struct_ref++;
    78.           e->funct_ref++;
    79.           engine_ref_debug(e, 0, 1)

crypto/engine/eng_init.c:78:9: 
    76.            */
    77.           e->struct_ref++;
    78. >         e->funct_ref++;
    79.           engine_ref_debug(e, 0, 1)
    80.               engine_ref_debug(e, 1, 1)

crypto/engine/eng_init.c:82:5: 
    80.               engine_ref_debug(e, 1, 1)
    81.       }
    82. >     return to_return;
    83.   }
    84.   

crypto/engine/eng_init.c:83:1: return from a call to engine_unlocked_init
    81.       }
    82.       return to_return;
    83. > }
    84.   
    85.   /*

crypto/engine/eng_init.c:136:5: 
  134.       CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
  135.       ret = engine_unlocked_init(e);
  136. >     CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
  137.       return ret;
  138.   }

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
    412.   }
    413.   
    414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
    415.   {
    416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
    439.       }
    440.   #endif
    441.       if (type < 0) {
                   ^
    442.           if (dynlock_lock_callback != NULL) {
    443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking true branch
    450.               CRYPTO_destroy_dynlockid(type);
    451.           }
    452.       } else if (locking_callback != NULL)
                          ^
    453.           locking_callback(mode, type, file, line);
    454.   }

crypto/lock.c:453:9: Skipping __function_pointer__(): unresolved function pointer
    451.           }
    452.       } else if (locking_callback != NULL)
    453.           locking_callback(mode, type, file, line);
                   ^
    454.   }
    455.   

crypto/lock.c:441:5: 
    439.       }
    440.   #endif
    441. >     if (type < 0) {
    442.           if (dynlock_lock_callback != NULL) {
    443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
    452.       } else if (locking_callback != NULL)
    453.           locking_callback(mode, type, file, line);
    454. > }
    455.   
    456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/engine/eng_init.c:137:5: 
  135.       ret = engine_unlocked_init(e);
  136.       CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
  137. >     return ret;
  138.   }
  139.   

crypto/engine/eng_init.c:138:1: return from a call to ENGINE_init
  136.       CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
  137.       return ret;
  138. > }
  139.   
  140.   /* The API (locked) version of "finish" */

crypto/ec/ec_kmeth.c:107:14: Taking false branch
105.   #ifndef OPENSSL_NO_ENGINE
106.       if (engine != NULL) {
107.           if (!ENGINE_init(engine)) {
                    ^
108.               ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_ENGINE_LIB);
109.               OPENSSL_free(ret);

crypto/ec/ec_kmeth.c:112:9: 
110.               return NULL;
111.           }
112. >         ret->engine = engine;
113.       } else
114.           ret->engine = ENGINE_get_default_EC();

crypto/ec/ec_kmeth.c:115:9: Taking true branch
113.       } else
114.           ret->engine = ENGINE_get_default_EC();
115.       if (ret->engine != NULL) {
               ^
116.           ret->meth = ENGINE_get_EC(ret->engine);
117.           if (ret->meth == NULL) {

crypto/ec/ec_kmeth.c:116:9: 
114.           ret->engine = ENGINE_get_default_EC();
115.       if (ret->engine != NULL) {
116. >         ret->meth = ENGINE_get_EC(ret->engine);
117.           if (ret->meth == NULL) {
118.               ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_ENGINE_LIB);

crypto/engine/tb_eckey.c:114:1: start of procedure ENGINE_get_EC()
  112.   
  113.   /* Obtains an EC_KEY implementation from an ENGINE functional reference */
  114. > const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e)
  115.   {
  116.       return e->ec_meth;

crypto/engine/tb_eckey.c:116:5: 
  114.   const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e)
  115.   {
  116. >     return e->ec_meth;
  117.   }
  118.   

crypto/engine/tb_eckey.c:117:1: return from a call to ENGINE_get_EC
  115.   {
  116.       return e->ec_meth;
  117. > }
  118.   
  119.   /* Sets an EC_KEY implementation in an ENGINE structure */

crypto/ec/ec_kmeth.c:117:13: Taking false branch
115.       if (ret->engine != NULL) {
116.           ret->meth = ENGINE_get_EC(ret->engine);
117.           if (ret->meth == NULL) {
                   ^
118.               ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_ENGINE_LIB);
119.               ENGINE_finish(ret->engine);

crypto/ec/ec_kmeth.c:126:5: 
124.   #endif
125.   
126. >     ret->version = 1;
127.       ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
128.       ret->references = 1;

crypto/ec/ec_kmeth.c:127:5: 
125.   
126.       ret->version = 1;
127. >     ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
128.       ret->references = 1;
129.       if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {

crypto/ec/ec_kmeth.c:128:5: 
126.       ret->version = 1;
127.       ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
128. >     ret->references = 1;
129.       if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
130.           EC_KEY_free(ret);

crypto/ec/ec_kmeth.c:129:9: Taking true branch
127.       ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
128.       ret->references = 1;
129.       if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
               ^
130.           EC_KEY_free(ret);
131.           return NULL;

crypto/ec/ec_kmeth.c:129:36: Taking true branch
127.       ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
128.       ret->references = 1;
129.       if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
                                          ^
130.           EC_KEY_free(ret);
131.           return NULL;

crypto/ec/ec_kmeth.c:130:9: Skipping EC_KEY_free(): empty list of specs
128.       ret->references = 1;
129.       if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
130.           EC_KEY_free(ret);
               ^
131.           return NULL;
132.       }
