Make OPENSSL_NO_COMP compile again.
[oweals/openssl.git] / crypto / asn1 / tasn_new.c
index 2b9bb997de09ca87f08f1064caaf2409d60a3ca1..4b046e5e748d40179e75e9d5090f6cb8619e3624 100644 (file)
@@ -146,7 +146,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                case ASN1_ITYPE_CHOICE:
                if (asn1_cb)
                        {
-                       i = asn1_cb(ASN1_OP_NEW_PRE, pval, it);
+                       i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
                        if (!i)
                                goto auxerr;
                        if (i==2)
@@ -166,7 +166,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                        memset(*pval, 0, it->size);
                        }
                asn1_set_choice_selector(pval, -1, it);
-               if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it))
+               if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
                                goto auxerr;
                break;
 
@@ -174,7 +174,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                case ASN1_ITYPE_SEQUENCE:
                if (asn1_cb)
                        {
-                       i = asn1_cb(ASN1_OP_NEW_PRE, pval, it);
+                       i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
                        if (!i)
                                goto auxerr;
                        if (i==2)
@@ -201,7 +201,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                        if (!ASN1_template_new(pseqval, tt))
                                goto memerr;
                        }
-               if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it))
+               if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
                                goto auxerr;
                break;
        }
@@ -211,14 +211,14 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
        return 1;
 
        memerr:
-       ASN1err(ASN1_F_ASN1_ITEM_NEW, ERR_R_MALLOC_FAILURE);
+       ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ERR_R_MALLOC_FAILURE);
 #ifdef CRYPTO_MDEBUG
        if (it->sname) CRYPTO_pop_info();
 #endif
        return 0;
 
        auxerr:
-       ASN1err(ASN1_F_ASN1_ITEM_NEW, ASN1_R_AUX_ERROR);
+       ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ASN1_R_AUX_ERROR);
        ASN1_item_ex_free(pval, it);
 #ifdef CRYPTO_MDEBUG
        if (it->sname) CRYPTO_pop_info();
@@ -326,11 +326,13 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
        {
        ASN1_TYPE *typ;
        int utype;
-       const ASN1_PRIMITIVE_FUNCS *pf;
-       pf = it->funcs;
 
-       if (pf && pf->prim_new)
-               return pf->prim_new(pval, it);
+       if (it && it->funcs)
+               {
+               const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
+               if (pf->prim_new)
+                       return pf->prim_new(pval, it);
+               }
 
        if (!it || (it->itype == ASN1_ITYPE_MSTRING))
                utype = -1;
@@ -374,10 +376,9 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
 void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
        {
        int utype;
-       const ASN1_PRIMITIVE_FUNCS *pf;
-       pf = it->funcs;
-       if (pf)
+       if (it && it->funcs)
                {
+               const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
                if (pf->prim_clear)
                        pf->prim_clear(pval, it);
                else