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


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

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

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

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

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

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

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

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

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

crypto/asn1/ameth_lib.c:229:10: 
  227.               return 0;
  228.       }
  229. >     if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth))
  230.           return 0;
  231.       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:229:10: Taking true branch
  227.               return 0;
  228.       }
  229.       if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth))
                  ^
  230.           return 0;
  231.       sk_EVP_PKEY_ASN1_METHOD_sort(app_methods);

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

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

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

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

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,
