crypto/asn1/ameth_lib.c:301: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_zalloc()` at line 277, column 35 is not reachable after line 301, column 5.
Showing all 65 steps of the trace


crypto/asn1/ameth_lib.c:274:1: start of procedure EVP_PKEY_asn1_new()
272.   }
273.   
274. > EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
275.                                           const char *pem_str, const char *info)
276.   {

crypto/asn1/ameth_lib.c:277:5: 
275.                                           const char *pem_str, const char *info)
276.   {
277. >     EVP_PKEY_ASN1_METHOD *ameth = OPENSSL_zalloc(sizeof(*ameth));
278.   
279.       if (ameth == 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.   #ifndef OPENSSL_NO_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/asn1/ameth_lib.c:279:9: Taking false branch
277.       EVP_PKEY_ASN1_METHOD *ameth = OPENSSL_zalloc(sizeof(*ameth));
278.   
279.       if (ameth == NULL)
               ^
280.           return NULL;
281.   

crypto/asn1/ameth_lib.c:282:5: 
280.           return NULL;
281.   
282. >     ameth->pkey_id = id;
283.       ameth->pkey_base_id = id;
284.       ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;

crypto/asn1/ameth_lib.c:283:5: 
281.   
282.       ameth->pkey_id = id;
283. >     ameth->pkey_base_id = id;
284.       ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;
285.   

crypto/asn1/ameth_lib.c:284:5: 
282.       ameth->pkey_id = id;
283.       ameth->pkey_base_id = id;
284. >     ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;
285.   
286.       if (info) {

crypto/asn1/ameth_lib.c:286:9: Taking true branch
284.       ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;
285.   
286.       if (info) {
               ^
287.           ameth->info = OPENSSL_strdup(info);
288.           if (!ameth->info)

crypto/asn1/ameth_lib.c:287:9: 
285.   
286.       if (info) {
287. >         ameth->info = OPENSSL_strdup(info);
288.           if (!ameth->info)
289.               goto err;

crypto/o_str.c:121:1: start of procedure CRYPTO_strdup()
  119.   }
  120.   
  121. > char *CRYPTO_strdup(const char *str, const char* file, int line)
  122.   {
  123.       char *ret;

crypto/o_str.c:125:9: Taking false branch
  123.       char *ret;
  124.   
  125.       if (str == NULL)
                 ^
  126.           return NULL;
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);

crypto/o_str.c:127:5: 
  125.       if (str == NULL)
  126.           return NULL;
  127. >     ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
  129.           strcpy(ret, str);

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.   #ifndef OPENSSL_NO_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/o_str.c:128:9: Taking true branch
  126.           return NULL;
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
                 ^
  129.           strcpy(ret, str);
  130.       return ret;

crypto/o_str.c:129:9: 
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
  129. >         strcpy(ret, str);
  130.       return ret;
  131.   }

crypto/o_str.c:130:5: 
  128.       if (ret != NULL)
  129.           strcpy(ret, str);
  130. >     return ret;
  131.   }
  132.   

crypto/o_str.c:131:1: return from a call to CRYPTO_strdup
  129.           strcpy(ret, str);
  130.       return ret;
  131. > }
  132.   
  133.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

crypto/asn1/ameth_lib.c:288:14: Taking false branch
286.       if (info) {
287.           ameth->info = OPENSSL_strdup(info);
288.           if (!ameth->info)
                    ^
289.               goto err;
290.       }

crypto/asn1/ameth_lib.c:292:9: Taking true branch
290.       }
291.   
292.       if (pem_str) {
               ^
293.           ameth->pem_str = OPENSSL_strdup(pem_str);
294.           if (!ameth->pem_str)

crypto/asn1/ameth_lib.c:293:9: 
291.   
292.       if (pem_str) {
293. >         ameth->pem_str = OPENSSL_strdup(pem_str);
294.           if (!ameth->pem_str)
295.               goto err;

crypto/o_str.c:121:1: start of procedure CRYPTO_strdup()
  119.   }
  120.   
  121. > char *CRYPTO_strdup(const char *str, const char* file, int line)
  122.   {
  123.       char *ret;

crypto/o_str.c:125:9: Taking false branch
  123.       char *ret;
  124.   
  125.       if (str == NULL)
                 ^
  126.           return NULL;
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);

crypto/o_str.c:127:5: 
  125.       if (str == NULL)
  126.           return NULL;
  127. >     ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
  129.           strcpy(ret, str);

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.   #ifndef OPENSSL_NO_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/o_str.c:128:9: Taking false branch
  126.           return NULL;
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
                 ^
  129.           strcpy(ret, str);
  130.       return ret;

crypto/o_str.c:130:5: 
  128.       if (ret != NULL)
  129.           strcpy(ret, str);
  130. >     return ret;
  131.   }
  132.   

crypto/o_str.c:131:1: return from a call to CRYPTO_strdup
  129.           strcpy(ret, str);
  130.       return ret;
  131. > }
  132.   
  133.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

crypto/asn1/ameth_lib.c:294:14: Taking true branch
292.       if (pem_str) {
293.           ameth->pem_str = OPENSSL_strdup(pem_str);
294.           if (!ameth->pem_str)
                    ^
295.               goto err;
296.       }

crypto/asn1/ameth_lib.c:300:2: 
298.       return ameth;
299.   
300. >  err:
301.       EVP_PKEY_asn1_free(ameth);
302.       return NULL;

crypto/asn1/ameth_lib.c:301:5: 
299.   
300.    err:
301. >     EVP_PKEY_asn1_free(ameth);
302.       return NULL;
303.   

crypto/asn1/ameth_lib.c:340:1: start of procedure EVP_PKEY_asn1_free()
  338.   }
  339.   
  340. > void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
  341.   {
  342.       if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) {

crypto/asn1/ameth_lib.c:342:9: Taking true branch
  340.   void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
  341.   {
  342.       if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) {
                 ^
  343.           OPENSSL_free(ameth->pem_str);
  344.           OPENSSL_free(ameth->info);

crypto/asn1/ameth_lib.c:342:19: Taking false branch
  340.   void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
  341.   {
  342.       if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) {
                           ^
  343.           OPENSSL_free(ameth->pem_str);
  344.           OPENSSL_free(ameth->info);

crypto/asn1/ameth_lib.c:342:5: 
  340.   void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
  341.   {
  342. >     if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) {
  343.           OPENSSL_free(ameth->pem_str);
  344.           OPENSSL_free(ameth->info);

crypto/asn1/ameth_lib.c:347:1: return from a call to EVP_PKEY_asn1_free
  345.           OPENSSL_free(ameth);
  346.       }
  347. > }
  348.   
  349.   void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
