crypto/asn1/ameth_lib.c:244: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_PKEY_asn1_new()` at line 239, column 13 is not reachable after line 244, column 9.
Showing all 64 steps of the trace


crypto/asn1/ameth_lib.c:236:1: start of procedure EVP_PKEY_asn1_add_alias()
234.   }
235.   
236. > int EVP_PKEY_asn1_add_alias(int to, int from)
237.   {
238.       EVP_PKEY_ASN1_METHOD *ameth;

crypto/asn1/ameth_lib.c:239:5: 
237.   {
238.       EVP_PKEY_ASN1_METHOD *ameth;
239. >     ameth = EVP_PKEY_asn1_new(from, ASN1_PKEY_ALIAS, NULL, NULL);
240.       if (ameth == NULL)
241.           return 0;

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: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: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 false 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:293:9: Taking false 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:299:5: 
  297.       }
  298.   
  299. >     return ameth;
  300.   
  301.    err:

crypto/asn1/ameth_lib.c:305:1: return from a call to EVP_PKEY_asn1_new
  303.       return NULL;
  304.   
  305. > }
  306.   
  307.   void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,

crypto/asn1/ameth_lib.c:240:9: Taking false branch
238.       EVP_PKEY_ASN1_METHOD *ameth;
239.       ameth = EVP_PKEY_asn1_new(from, ASN1_PKEY_ALIAS, NULL, NULL);
240.       if (ameth == NULL)
               ^
241.           return 0;
242.       ameth->pkey_base_id = to;

crypto/asn1/ameth_lib.c:242:5: 
240.       if (ameth == NULL)
241.           return 0;
242. >     ameth->pkey_base_id = to;
243.       if (!EVP_PKEY_asn1_add0(ameth)) {
244.           EVP_PKEY_asn1_free(ameth);

crypto/asn1/ameth_lib.c:243:10: 
241.           return 0;
242.       ameth->pkey_base_id = to;
243. >     if (!EVP_PKEY_asn1_add0(ameth)) {
244.           EVP_PKEY_asn1_free(ameth);
245.           return 0;

crypto/asn1/ameth_lib.c:223:1: start of procedure EVP_PKEY_asn1_add0()
  221.   }
  222.   
  223. > int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth)
  224.   {
  225.       if (app_methods == NULL) {

crypto/asn1/ameth_lib.c:225:9: Taking false branch
  223.   int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth)
  224.   {
  225.       if (app_methods == NULL) {
                 ^
  226.           app_methods = sk_EVP_PKEY_ASN1_METHOD_new(ameth_cmp);
  227.           if (app_methods == NULL)

crypto/asn1/ameth_lib.c:230:10: 
  228.               return 0;
  229.       }
  230. >     if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth))
  231.           return 0;
  232.       sk_EVP_PKEY_ASN1_METHOD_sort(app_methods);

crypto/include/internal/asn1_int.h:107:1: start of procedure sk_EVP_PKEY_ASN1_METHOD_push()
    105.   } /* EVP_PKEY_ASN1_METHOD */ ;
    106.   
    107. > DEFINE_STACK_OF_CONST(EVP_PKEY_ASN1_METHOD)
    108.   
    109.   extern const EVP_PKEY_ASN1_METHOD cmac_asn1_meth;

crypto/stack/stack.c:259:1: start of procedure sk_push()
      257.   }
      258.   
      259. > int sk_push(_STACK *st, void *data)
      260.   {
      261.       return (sk_insert(st, data, st->num));

crypto/stack/stack.c:261:5: 
      259.   int sk_push(_STACK *st, void *data)
      260.   {
      261. >     return (sk_insert(st, data, st->num));
      262.   }
      263.   

crypto/stack/stack.c:167:1: start of procedure sk_insert()
        165.   }
        166.   
        167. > int sk_insert(_STACK *st, void *data, int loc)
        168.   {
        169.       char **s;

crypto/stack/stack.c:171:9: Taking false branch
        169.       char **s;
        170.   
        171.       if (st == NULL)
                       ^
        172.           return 0;
        173.       if (st->num_alloc <= st->num + 1) {

crypto/stack/stack.c:173:9: Taking true branch
        171.       if (st == NULL)
        172.           return 0;
        173.       if (st->num_alloc <= st->num + 1) {
                       ^
        174.           s = OPENSSL_realloc((char *)st->data,
        175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);

crypto/stack/stack.c:174:9: 
        172.           return 0;
        173.       if (st->num_alloc <= st->num + 1) {
        174. >         s = OPENSSL_realloc((char *)st->data,
        175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
        176.           if (s == NULL)

crypto/mem.c:166:1: start of procedure CRYPTO_realloc()
          164.   }
          165.   
          166. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
          167.   {
          168.       if (str == NULL)

crypto/mem.c:168:9: Taking true branch
          166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
          167.   {
          168.       if (str == NULL)
                         ^
          169.           return CRYPTO_malloc(num, file, line);
          170.   

crypto/mem.c:169:9: 
          167.   {
          168.       if (str == NULL)
          169. >         return CRYPTO_malloc(num, file, line);
          170.   
          171.       if (num == 0) {

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 true branch
            122.       void *ret = NULL;
            123.   
            124.       if (num <= 0)
                           ^
            125.           return NULL;
            126.   

crypto/mem.c:125:9: 
            123.   
            124.       if (num <= 0)
            125. >         return NULL;
            126.   
            127.       allow_customize = 0;

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:191:1: return from a call to CRYPTO_realloc
          189.       return realloc(str, num);
          190.   
          191. > }
          192.   
          193.   void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,

crypto/stack/stack.c:176:13: Taking true branch
        174.           s = OPENSSL_realloc((char *)st->data,
        175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
        176.           if (s == NULL)
                           ^
        177.               return (0);
        178.           st->data = s;

crypto/stack/stack.c:177:13: 
        175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
        176.           if (s == NULL)
        177. >             return (0);
        178.           st->data = s;
        179.           st->num_alloc *= 2;

crypto/stack/stack.c:191:1: return from a call to sk_insert
        189.       st->sorted = 0;
        190.       return (st->num);
        191. > }
        192.   
        193.   void *sk_delete_ptr(_STACK *st, void *p)

crypto/stack/stack.c:262:1: return from a call to sk_push
      260.   {
      261.       return (sk_insert(st, data, st->num));
      262. > }
      263.   
      264.   int sk_unshift(_STACK *st, void *data)

crypto/include/internal/asn1_int.h:107:1: return from a call to sk_EVP_PKEY_ASN1_METHOD_push
    105.   } /* EVP_PKEY_ASN1_METHOD */ ;
    106.   
    107. > DEFINE_STACK_OF_CONST(EVP_PKEY_ASN1_METHOD)
    108.   
    109.   extern const EVP_PKEY_ASN1_METHOD cmac_asn1_meth;

crypto/asn1/ameth_lib.c:230:10: Taking true branch
  228.               return 0;
  229.       }
  230.       if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth))
                  ^
  231.           return 0;
  232.       sk_EVP_PKEY_ASN1_METHOD_sort(app_methods);

crypto/asn1/ameth_lib.c:231:9: 
  229.       }
  230.       if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth))
  231. >         return 0;
  232.       sk_EVP_PKEY_ASN1_METHOD_sort(app_methods);
  233.       return 1;

crypto/asn1/ameth_lib.c:234:1: return from a call to EVP_PKEY_asn1_add0
  232.       sk_EVP_PKEY_ASN1_METHOD_sort(app_methods);
  233.       return 1;
  234. > }
  235.   
  236.   int EVP_PKEY_asn1_add_alias(int to, int from)

crypto/asn1/ameth_lib.c:243:10: Taking true branch
241.           return 0;
242.       ameth->pkey_base_id = to;
243.       if (!EVP_PKEY_asn1_add0(ameth)) {
                ^
244.           EVP_PKEY_asn1_free(ameth);
245.           return 0;

crypto/asn1/ameth_lib.c:244:9: 
242.       ameth->pkey_base_id = to;
243.       if (!EVP_PKEY_asn1_add0(ameth)) {
244. >         EVP_PKEY_asn1_free(ameth);
245.           return 0;
246.       }

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,
