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.   DEFINE_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.   DEFINE_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;

static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
                              struct v3_ext_ctx *ctx,
                              STACK_OF(CONF_VALUE) *values)
{
    static const char v4addr_chars[] = "0123456789.";
    static const char v6addr_chars[] = "0123456789.:abcdefABCDEF";
    IPAddrBlocks *addr = NULL;
    char *s = NULL, *t;
    int i;
    if ((addr = sk_IPAddressFamily_new(IPAddressFamily_cmp)) == NULL) {
        X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
        return NULL;
    }
    for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
        CONF_VALUE *val = sk_CONF_VALUE_value(values, i);
        unsigned char min[ADDR_RAW_BUF_LEN], max[ADDR_RAW_BUF_LEN];
        unsigned afi, *safi = NULL, safi_;
        const char *addr_chars = NULL;
        int prefixlen, i1, i2, delim, length;
        if (!name_cmp(val->name, "IPv4")) {
            afi = IANA_AFI_IPV4;
        } else if (!name_cmp(val->name, "IPv6")) {
            afi = IANA_AFI_IPV6;
        } else if (!name_cmp(val->name, "IPv4-SAFI")) {
            afi = IANA_AFI_IPV4;
            safi = &safi_;
        } else if (!name_cmp(val->name, "IPv6-SAFI")) {
            afi = IANA_AFI_IPV6;
            safi = &safi_;
        } else {
            X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
                      X509V3_R_EXTENSION_NAME_ERROR);
            X509V3_conf_err(val);
            goto err;
        }
        switch (afi) {
        case IANA_AFI_IPV4:
            addr_chars = v4addr_chars;
            break;
        case IANA_AFI_IPV6:
            addr_chars = v6addr_chars;
            break;
        }
        length = length_from_afi(afi);
        if (safi != NULL) {
            *safi = strtoul(val->value, &t, 0);
            t += strspn(t, " \t");
            if (*safi > 0xFF || *t++ != ':') {
                X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_SAFI);
                X509V3_conf_err(val);
                goto err;
            }
            t += strspn(t, " \t");
            s = OPENSSL_strdup(t);
        } else {
            s = OPENSSL_strdup(val->value);
        }
        if (s == NULL) {
            X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
            goto err;
        }
        if (strcmp(s, "inherit") == 0) {
            if (!v3_addr_add_inherit(addr, afi, safi)) {
                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
                          X509V3_R_INVALID_INHERITANCE);
                X509V3_conf_err(val);
                goto err;
            }
            OPENSSL_free(s);
            s = NULL;
            continue;
        }
        i1 = strspn(s, addr_chars);
        i2 = i1 + strspn(s + i1, " \t");
        delim = s[i2++];
        s[i1] = '\0';
        if (a2i_ipadd(min, s) != length) {
            X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_IPADDRESS);
            X509V3_conf_err(val);
            goto err;
        }
        switch (delim) {
        case '/':
            prefixlen = (int)strtoul(s + i2, &t, 10);
            if (t == s + i2 || *t != '\0') {
                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
                          X509V3_R_EXTENSION_VALUE_ERROR);
                X509V3_conf_err(val);
                goto err;
            }
            if (!v3_addr_add_prefix(addr, afi, safi, min, prefixlen)) {
                X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
                goto err;
            }
            break;
        case '-':
            i1 = i2 + strspn(s + i2, " \t");
            i2 = i1 + strspn(s + i1, addr_chars);
            if (i1 == i2 || s[i2] != '\0') {
                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
                          X509V3_R_EXTENSION_VALUE_ERROR);
                X509V3_conf_err(val);
                goto err;
            }
            if (a2i_ipadd(max, s + i1) != length) {
                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
                          X509V3_R_INVALID_IPADDRESS);
                X509V3_conf_err(val);
                goto err;
            }
            if (memcmp(min, max, length_from_afi(afi)) > 0) {
                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
                          X509V3_R_EXTENSION_VALUE_ERROR);
                X509V3_conf_err(val);
                goto err;
            }
            if (!v3_addr_add_range(addr, afi, safi, min, max)) {
                X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
                goto err;
            }
            break;
        case '\0':
            if (!v3_addr_add_prefix(addr, afi, safi, min, length * 8)) {
                X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
                goto err;
            }
            break;
        default:
            X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
                      X509V3_R_EXTENSION_VALUE_ERROR);
            X509V3_conf_err(val);
            goto err;
        }
        OPENSSL_free(s);
        s = NULL;
    }
    if (!v3_addr_canonize(addr))
        goto err;
    return addr;
 err:
    OPENSSL_free(s);
    sk_IPAddressFamily_pop_free(addr, IPAddressFamily_free);
    return NULL;
}
['static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,\n                              struct v3_ext_ctx *ctx,\n                              STACK_OF(CONF_VALUE) *values)\n{\n    static const char v4addr_chars[] = "0123456789.";\n    static const char v6addr_chars[] = "0123456789.:abcdefABCDEF";\n    IPAddrBlocks *addr = NULL;\n    char *s = NULL, *t;\n    int i;\n    if ((addr = sk_IPAddressFamily_new(IPAddressFamily_cmp)) == NULL) {\n        X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);\n        return NULL;\n    }\n    for (i = 0; i < sk_CONF_VALUE_num(values); i++) {\n        CONF_VALUE *val = sk_CONF_VALUE_value(values, i);\n        unsigned char min[ADDR_RAW_BUF_LEN], max[ADDR_RAW_BUF_LEN];\n        unsigned afi, *safi = NULL, safi_;\n        const char *addr_chars = NULL;\n        int prefixlen, i1, i2, delim, length;\n        if (!name_cmp(val->name, "IPv4")) {\n            afi = IANA_AFI_IPV4;\n        } else if (!name_cmp(val->name, "IPv6")) {\n            afi = IANA_AFI_IPV6;\n        } else if (!name_cmp(val->name, "IPv4-SAFI")) {\n            afi = IANA_AFI_IPV4;\n            safi = &safi_;\n        } else if (!name_cmp(val->name, "IPv6-SAFI")) {\n            afi = IANA_AFI_IPV6;\n            safi = &safi_;\n        } else {\n            X509V3err(X509V3_F_V2I_IPADDRBLOCKS,\n                      X509V3_R_EXTENSION_NAME_ERROR);\n            X509V3_conf_err(val);\n            goto err;\n        }\n        switch (afi) {\n        case IANA_AFI_IPV4:\n            addr_chars = v4addr_chars;\n            break;\n        case IANA_AFI_IPV6:\n            addr_chars = v6addr_chars;\n            break;\n        }\n        length = length_from_afi(afi);\n        if (safi != NULL) {\n            *safi = strtoul(val->value, &t, 0);\n            t += strspn(t, " \\t");\n            if (*safi > 0xFF || *t++ != \':\') {\n                X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_SAFI);\n                X509V3_conf_err(val);\n                goto err;\n            }\n            t += strspn(t, " \\t");\n            s = OPENSSL_strdup(t);\n        } else {\n            s = OPENSSL_strdup(val->value);\n        }\n        if (s == NULL) {\n            X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);\n            goto err;\n        }\n        if (strcmp(s, "inherit") == 0) {\n            if (!v3_addr_add_inherit(addr, afi, safi)) {\n                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,\n                          X509V3_R_INVALID_INHERITANCE);\n                X509V3_conf_err(val);\n                goto err;\n            }\n            OPENSSL_free(s);\n            s = NULL;\n            continue;\n        }\n        i1 = strspn(s, addr_chars);\n        i2 = i1 + strspn(s + i1, " \\t");\n        delim = s[i2++];\n        s[i1] = \'\\0\';\n        if (a2i_ipadd(min, s) != length) {\n            X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_IPADDRESS);\n            X509V3_conf_err(val);\n            goto err;\n        }\n        switch (delim) {\n        case \'/\':\n            prefixlen = (int)strtoul(s + i2, &t, 10);\n            if (t == s + i2 || *t != \'\\0\') {\n                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,\n                          X509V3_R_EXTENSION_VALUE_ERROR);\n                X509V3_conf_err(val);\n                goto err;\n            }\n            if (!v3_addr_add_prefix(addr, afi, safi, min, prefixlen)) {\n                X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);\n                goto err;\n            }\n            break;\n        case \'-\':\n            i1 = i2 + strspn(s + i2, " \\t");\n            i2 = i1 + strspn(s + i1, addr_chars);\n            if (i1 == i2 || s[i2] != \'\\0\') {\n                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,\n                          X509V3_R_EXTENSION_VALUE_ERROR);\n                X509V3_conf_err(val);\n                goto err;\n            }\n            if (a2i_ipadd(max, s + i1) != length) {\n                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,\n                          X509V3_R_INVALID_IPADDRESS);\n                X509V3_conf_err(val);\n                goto err;\n            }\n            if (memcmp(min, max, length_from_afi(afi)) > 0) {\n                X509V3err(X509V3_F_V2I_IPADDRBLOCKS,\n                          X509V3_R_EXTENSION_VALUE_ERROR);\n                X509V3_conf_err(val);\n                goto err;\n            }\n            if (!v3_addr_add_range(addr, afi, safi, min, max)) {\n                X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);\n                goto err;\n            }\n            break;\n        case \'\\0\':\n            if (!v3_addr_add_prefix(addr, afi, safi, min, length * 8)) {\n                X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);\n                goto err;\n            }\n            break;\n        default:\n            X509V3err(X509V3_F_V2I_IPADDRBLOCKS,\n                      X509V3_R_EXTENSION_VALUE_ERROR);\n            X509V3_conf_err(val);\n            goto err;\n        }\n        OPENSSL_free(s);\n        s = NULL;\n    }\n    if (!v3_addr_canonize(addr))\n        goto err;\n    return addr;\n err:\n    OPENSSL_free(s);\n    sk_IPAddressFamily_pop_free(addr, IPAddressFamily_free);\n    return NULL;\n}', 'DEFINE_STACK_OF(IPAddressFamily)', '_STACK *sk_new(int (*c) (const void *, const void *))\n{\n    _STACK *ret;\n    if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)\n        goto err;\n    if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)\n        goto err;\n    ret->comp = c;\n    ret->num_alloc = MIN_NODES;\n    return (ret);\n err:\n    OPENSSL_free(ret);\n    return (NULL);\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'int sk_num(const _STACK *st)\n{\n    if (st == NULL)\n        return -1;\n    return st->num;\n}']