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


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

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

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

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

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

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

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

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

crypto/o_str.c:125:9: Taking false branch
  123.       size_t size;
  124.   
  125.       if (str == NULL)
                 ^
  126.           return NULL;
  127.       size = strlen(str) + 1;

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

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

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

crypto/o_str.c:130:9: 
  128.       ret = CRYPTO_malloc(size, file, line);
  129.       if (ret != NULL)
  130. >         memcpy(ret, str, size);
  131.       return ret;
  132.   }

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

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

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

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

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

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

crypto/o_str.c:125:9: Taking false branch
  123.       size_t size;
  124.   
  125.       if (str == NULL)
                 ^
  126.           return NULL;
  127.       size = strlen(str) + 1;

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

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

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

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

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

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

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

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

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

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

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

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

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