crypto/x509v3/v3_addr.c:1091: error: MEMORY_LEAK
  memory dynamically allocated by call to `sk_IPAddressFamily_new()` at line 942, column 17 is not reachable after line 1091, column 10.
Showing all 58 steps of the trace


crypto/x509v3/v3_addr.c:932:1: start of procedure v2i_IPAddrBlocks()
930.    * v2i handler for the IPAddrBlocks extension.
931.    */
932. > static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
933.                                 struct v3_ext_ctx *ctx,
934.                                 STACK_OF(CONF_VALUE) *values)

crypto/x509v3/v3_addr.c:936:5: 
934.                                 STACK_OF(CONF_VALUE) *values)
935.   {
936. >     static const char v4addr_chars[] = "0123456789.";
937.       static const char v6addr_chars[] = "0123456789.:abcdefABCDEF";
938.       IPAddrBlocks *addr = NULL;

crypto/x509v3/v3_addr.c:937:5: 
935.   {
936.       static const char v4addr_chars[] = "0123456789.";
937. >     static const char v6addr_chars[] = "0123456789.:abcdefABCDEF";
938.       IPAddrBlocks *addr = NULL;
939.       char *s = NULL, *t;

crypto/x509v3/v3_addr.c:938:5: 
936.       static const char v4addr_chars[] = "0123456789.";
937.       static const char v6addr_chars[] = "0123456789.:abcdefABCDEF";
938. >     IPAddrBlocks *addr = NULL;
939.       char *s = NULL, *t;
940.       int i;

crypto/x509v3/v3_addr.c:939:5: 
937.       static const char v6addr_chars[] = "0123456789.:abcdefABCDEF";
938.       IPAddrBlocks *addr = NULL;
939. >     char *s = NULL, *t;
940.       int i;
941.   

crypto/x509v3/v3_addr.c:942:9: 
940.       int i;
941.   
942. >     if ((addr = sk_IPAddressFamily_new(IPAddressFamily_cmp)) == NULL) {
943.           X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
944.           return NULL;

include/openssl/x509v3.h:839:1: start of procedure sk_IPAddressFamily_new()
  837.   
  838.   typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
  839. > DEFINE_STACK_OF(IPAddressFamily)
  840.   
  841.   DECLARE_ASN1_FUNCTIONS(IPAddressRange)

crypto/stack/stack.c:150:1: start of procedure sk_new()
    148.   }
    149.   
    150. > _STACK *sk_new(int (*c) (const void *, const void *))
    151.   {
    152.       _STACK *ret;

crypto/stack/stack.c:154:9: 
    152.       _STACK *ret;
    153.   
    154. >     if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
    155.           goto err;
    156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == 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/stack/stack.c:154:9: Taking false branch
    152.       _STACK *ret;
    153.   
    154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
                   ^
    155.           goto err;
    156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)

crypto/stack/stack.c:156:9: 
    154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
    155.           goto err;
    156. >     if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
    157.           goto err;
    158.       ret->comp = c;

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/stack/stack.c:156:9: Taking false branch
    154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
    155.           goto err;
    156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
                   ^
    157.           goto err;
    158.       ret->comp = c;

crypto/stack/stack.c:158:5: 
    156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
    157.           goto err;
    158. >     ret->comp = c;
    159.       ret->num_alloc = MIN_NODES;
    160.       return (ret);

crypto/stack/stack.c:159:5: 
    157.           goto err;
    158.       ret->comp = c;
    159. >     ret->num_alloc = MIN_NODES;
    160.       return (ret);
    161.   

crypto/stack/stack.c:160:5: 
    158.       ret->comp = c;
    159.       ret->num_alloc = MIN_NODES;
    160. >     return (ret);
    161.   
    162.    err:

crypto/stack/stack.c:165:1: return from a call to sk_new
    163.       OPENSSL_free(ret);
    164.       return (NULL);
    165. > }
    166.   
    167.   int sk_insert(_STACK *st, void *data, int loc)

include/openssl/x509v3.h:839:1: return from a call to sk_IPAddressFamily_new
  837.   
  838.   typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
  839. > DEFINE_STACK_OF(IPAddressFamily)
  840.   
  841.   DECLARE_ASN1_FUNCTIONS(IPAddressRange)

crypto/x509v3/v3_addr.c:942:9: Taking false branch
940.       int i;
941.   
942.       if ((addr = sk_IPAddressFamily_new(IPAddressFamily_cmp)) == NULL) {
               ^
943.           X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
944.           return NULL;

crypto/x509v3/v3_addr.c:947:10: 
945.       }
946.   
947. >     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
948.           CONF_VALUE *val = sk_CONF_VALUE_value(values, i);
949.           unsigned char min[ADDR_RAW_BUF_LEN], max[ADDR_RAW_BUF_LEN];

crypto/x509v3/v3_addr.c:947:17: 
945.       }
946.   
947. >     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
948.           CONF_VALUE *val = sk_CONF_VALUE_value(values, i);
949.           unsigned char min[ADDR_RAW_BUF_LEN], max[ADDR_RAW_BUF_LEN];

include/openssl/conf.h:80:1: start of procedure sk_CONF_VALUE_num()
  78.   } CONF_VALUE;
  79.   
  80. > DEFINE_STACK_OF(CONF_VALUE)
  81.   DECLARE_LHASH_OF(CONF_VALUE);
  82.   

crypto/stack/stack.c:317:1: start of procedure sk_num()
    315.   }
    316.   
    317. > int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)

crypto/stack/stack.c:319:9: Taking true branch
    317.   int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)
                   ^
    320.           return -1;
    321.       return st->num;

crypto/stack/stack.c:320:9: 
    318.   {
    319.       if (st == NULL)
    320. >         return -1;
    321.       return st->num;
    322.   }

crypto/stack/stack.c:322:1: return from a call to sk_num
    320.           return -1;
    321.       return st->num;
    322. > }
    323.   
    324.   void *sk_value(const _STACK *st, int i)

include/openssl/conf.h:80:1: return from a call to sk_CONF_VALUE_num
  78.   } CONF_VALUE;
  79.   
  80. > DEFINE_STACK_OF(CONF_VALUE)
  81.   DECLARE_LHASH_OF(CONF_VALUE);
  82.   

crypto/x509v3/v3_addr.c:947:17: Loop condition is false. Leaving loop
945.       }
946.   
947.       for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
                       ^
948.           CONF_VALUE *val = sk_CONF_VALUE_value(values, i);
949.           unsigned char min[ADDR_RAW_BUF_LEN], max[ADDR_RAW_BUF_LEN];

crypto/x509v3/v3_addr.c:1091:10: Skipping v3_addr_canonize(): empty list of specs
1089.        * Canonize the result, then we're done.
1090.        */
1091.       if (!v3_addr_canonize(addr))
                 ^
1092.           goto err;
1093.       return addr;
